• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# VersionStamp类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中VersionStamp的典型用法代码示例。如果您正苦于以下问题:C# VersionStamp类的具体用法?C# VersionStamp怎么用?C# VersionStamp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VersionStamp类属于命名空间,在下文中一共展示了VersionStamp类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ShouldCreateFromScratch

        private static bool ShouldCreateFromScratch(
            Solution solution,
            IAssemblySymbol assembly,
            string filePath,
            out string prefix,
            out VersionStamp version,
            CancellationToken cancellationToken)
        {
            prefix = null;
            version = default(VersionStamp);

            var service = solution.Workspace.Services.GetService<IAssemblySerializationInfoService>();
            if (service == null)
            {
                return true;
            }

            // check whether the assembly that belong to a solution is something we can serialize
            if (!service.Serializable(solution, filePath))
            {
                return true;
            }

            if (!service.TryGetSerializationPrefixAndVersion(solution, filePath, out prefix, out version))
            {
                return true;
            }

            return false;
        }
开发者ID:peter76111,项目名称:roslyn,代码行数:30,代码来源:SymbolTreeInfo_Serialization.cs


示例2: TryGetSerializationPrefixAndVersion

        public bool TryGetSerializationPrefixAndVersion(Solution solution, string assemblyFilePath, out string prefix, out VersionStamp version)
        {
            prefix = FilePathUtilities.GetRelativePath(solution.FilePath, assemblyFilePath);
            version = VersionStamp.Create(File.GetLastWriteTimeUtc(assemblyFilePath));

            return true;
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:7,代码来源:AssemblySerializationInfoService.cs


示例3: SyntaxTreeContextInfo

 private SyntaxTreeContextInfo(VersionStamp version, int predefinedTypes, int predefinedOperators, ContainingNodes containingNodes) :
     base(version)
 {
     _predefinedTypes = predefinedTypes;
     _predefinedOperators = predefinedOperators;
     _containingNodes = containingNodes;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:SyntaxTreeContextInfo.cs


示例4: SolutionState

        private SolutionState(
            BranchId branchId,
            int workspaceVersion,
            SolutionServices solutionServices,
            SolutionId id,
            string filePath,
            IEnumerable<ProjectId> projectIds,
            ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
            ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
            ImmutableDictionary<string, ImmutableArray<DocumentId>> linkedFilesMap,
            ProjectDependencyGraph dependencyGraph,
            VersionStamp version,
            Lazy<VersionStamp> lazyLatestProjectVersion)
        {
            _branchId = branchId;
            _workspaceVersion = workspaceVersion;
            _id = id;
            _filePath = filePath;
            _solutionServices = solutionServices;
            _projectIds = projectIds.ToImmutableReadOnlyListOrEmpty();
            _projectIdToProjectStateMap = idToProjectStateMap;
            _projectIdToTrackerMap = projectIdToTrackerMap;
            _linkedFilesMap = linkedFilesMap;
            _dependencyGraph = dependencyGraph;
            _version = version;
            _lazyLatestProjectVersion = lazyLatestProjectVersion;

            CheckInvariants();
        }
开发者ID:tvsonar,项目名称:roslyn,代码行数:29,代码来源:SolutionState.cs


示例5: Solution

        private Solution(
            BranchId branchId,
            int workspaceVersion,
            SolutionServices solutionServices,
            SolutionId id,
            string filePath,
            ImmutableList<ProjectId> projectIds,
            ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
            ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
            ProjectDependencyGraph dependencyGraph,
            VersionStamp version,
            Lazy<VersionStamp> lazyLatestProjectVersion)
        {
            this.branchId = branchId;
            this.workspaceVersion = workspaceVersion;
            this.id = id;
            this.filePath = filePath;
            this.solutionServices = solutionServices;
            this.projectIds = projectIds;
            this.projectIdToProjectStateMap = idToProjectStateMap;
            this.projectIdToTrackerMap = projectIdToTrackerMap;
            this.dependencyGraph = dependencyGraph;
            this.projectIdToProjectMap = ImmutableHashMap<ProjectId, Project>.Empty;
            this.version = version;
            this.lazyLatestProjectVersion = lazyLatestProjectVersion;

            CheckInvariants();
        }
开发者ID:riversky,项目名称:roslyn,代码行数:28,代码来源:Solution.cs


示例6: CanReusePersistedSyntaxTreeVersion

        public static bool CanReusePersistedSyntaxTreeVersion(this Document document, VersionStamp syntaxVersion, VersionStamp persistedVersion)
        {
            var canReuse = VersionStamp.CanReusePersistedVersion(syntaxVersion, persistedVersion);

            PersistedVersionStampLogger.LogPersistedSyntaxTreeVersionUsage(canReuse);
            return canReuse;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:Extensions.cs


示例7: TryGetReference

        internal static bool TryGetReference(
            Solution solution, ProjectReference projectReference, Compilation finalOrDeclarationCompilation, VersionStamp version, out MetadataReference reference)
        {
            // if we have one from snapshot cache, use it. it will make sure same compilation will get same metadata reference always.
            MetadataOnlyReferenceSet referenceSet;
            if (s_snapshotCache.TryGetValue(finalOrDeclarationCompilation, out referenceSet))
            {
                reference = referenceSet.GetMetadataReference(finalOrDeclarationCompilation, projectReference.Aliases, projectReference.EmbedInteropTypes);
                return true;
            }

            // okay, now use version based cache that can live multiple compilation as long as there is no semantic changes.

            // get one for the branch
            if (TryGetReferenceFromBranch(solution.BranchId, projectReference, finalOrDeclarationCompilation, version, out reference))
            {
                return true;
            }

            // see whether we can use primary branch one
            var primaryBranchId = solution.Workspace.PrimaryBranchId;
            if (solution.BranchId != primaryBranchId &&
                TryGetReferenceFromBranch(primaryBranchId, projectReference, finalOrDeclarationCompilation, version, out reference))
            {
                return true;
            }

            // noop, we don't have any
            reference = null;
            return false;
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:31,代码来源:MetadataOnlyReference.cs


示例8: CanReusePersistedDependentProjectVersion

        public static bool CanReusePersistedDependentProjectVersion(this Project project, VersionStamp dependentProjectVersion, VersionStamp persistedVersion)
        {
            var canReuse = VersionStamp.CanReusePersistedVersion(dependentProjectVersion, persistedVersion);

            PersistedVersionStampLogger.LogPersistedDependentProjectVersionUsage(canReuse);
            return canReuse;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:Extensions.cs


示例9: TryGetSerializationPrefixAndVersion

        public bool TryGetSerializationPrefixAndVersion(Solution solution, string assemblyFilePath, out string prefix, out VersionStamp version)
        {
            prefix = string.Empty;
            version = VersionStamp.Default;

            return false;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:AssemblySerializationInfoService.cs


示例10: CanReusePersistedTextVersion

        public static bool CanReusePersistedTextVersion(this Document document, VersionStamp textVersion, VersionStamp persistedVersion)
        {
            var canReuse = VersionStamp.CanReusePersistedVersion(textVersion, persistedVersion);

            PersistedVersionStampLogger.LogPersistedTextVersionUsage(canReuse);
            return canReuse;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:Extensions.cs


示例11: SymbolTreeInfo

 private SymbolTreeInfo(VersionStamp version, IReadOnlyList<Node> orderedNodes, SpellChecker spellChecker)
     : this(version, orderedNodes, new Lazy<SpellChecker>(() => spellChecker))
 {
     // Make the lazy 'Created'.  This is a no-op since we already have the underlying spell
     // checker.  This way if we end up wanting to serialize this tree info, we'll also
     // serialize the spell checker.
     var unused = _lazySpellChecker.Value;
 }
开发者ID:braegelno5,项目名称:roslyn,代码行数:8,代码来源:SymbolTreeInfo.cs


示例12: NavigationBarModel

        public NavigationBarModel(IList<NavigationBarItem> types, VersionStamp semanticVersionStamp, INavigationBarItemService itemService)
        {
            Contract.ThrowIfNull(types);

            this.Types = types;
            this.SemanticVersionStamp = semanticVersionStamp;
            this.ItemService = itemService;
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:8,代码来源:NavigationBarModel.cs


示例13: ProjectAnalysisData

            public ProjectAnalysisData(ProjectId projectId, VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, AnalysisResult> result)
            {
                ProjectId = projectId;
                Version = version;
                Result = result;

                OldResult = null;
            }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:8,代码来源:DiagnosticIncrementalAnalyzer.AnalysisData.cs


示例14: Create

 /// <summary>
 /// Create a new instance of a SolutionInfo.
 /// </summary>
 public static SolutionInfo Create(
     SolutionId id,
     VersionStamp version,
     string filePath = null,
     IEnumerable<ProjectInfo> projects = null)
 {
     return new SolutionInfo(new SolutionAttributes(id, version, filePath), projects);
 }
开发者ID:otawfik-ms,项目名称:roslyn,代码行数:11,代码来源:SolutionInfo.cs


示例15: Create

        public static TreeAndVersion Create(SyntaxTree tree, VersionStamp version)
        {
            if (tree == null)
            {
                throw new ArgumentNullException("tree");
            }

            return new TreeAndVersion(tree, version);
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:9,代码来源:TreeAndVersion.cs


示例16: CanReusePersistedDependentSemanticVersion

        public static bool CanReusePersistedDependentSemanticVersion(
            this Project project, VersionStamp dependentProjectVersion, VersionStamp dependentSemanticVersion, VersionStamp persistedVersion)
        {
            var canReuse = CanReusePersistedSemanticVersionInternal(
                project, dependentProjectVersion, dependentSemanticVersion, persistedVersion, (s, p, v) => s.GetInitialDependentProjectVersionFromDependentSemanticVersion(p, v));

            PersistedVersionStampLogger.LogPersistedDependentSemanticVersionUsage(canReuse);
            return canReuse;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:9,代码来源:Extensions.cs


示例17: From

        /// <summary>
        /// Creates a TextLoader from a SourceTextContainer and version. 
        /// 
        /// The text obtained from the loader will be the current text of the container at the time
        /// the loader is accessed.
        /// </summary>
        public static TextLoader From(SourceTextContainer container, VersionStamp version, string filePath = null)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            return new TextContainerLoader(container, version, filePath);
        }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:15,代码来源:TextLoader.cs


示例18: Create

        /// <summary>
        /// Create a new TextAndVersion instance.
        /// </summary>
        /// <param name="text">The text</param>
        /// <param name="version">The version</param>
        /// <param name="filePath">An optional file path that identifies the original of the source text.</param>
        /// <returns></returns>
        public static TextAndVersion Create(SourceText text, VersionStamp version, string filePath = null)
        {
            if (text == null)
            {
                throw new ArgumentNullException("text");
            }

            return new TextAndVersion(text, version, filePath);
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:16,代码来源:TextAndVersion.cs


示例19: GetOrBuildReference

        internal static MetadataReference GetOrBuildReference(
            Solution solution,
            ProjectReference projectReference,
            Compilation finalCompilation,
            VersionStamp version,
            CancellationToken cancellationToken)
        {
            MetadataReference reference;
            if (TryGetReference(solution, projectReference, finalCompilation, version, out reference))
            {
                return reference;
            }

            // okay, we don't have one. so create one now.

            // first, prepare image
            // * NOTE * image is cancellable, do not create it inside of conditional weak table.
            var service = solution.Workspace.Services.GetService<ITemporaryStorageService>();
            var image = MetadataOnlyImage.Create(service, finalCompilation, cancellationToken);
            if (image.IsEmpty)
            {
                // unfortunately, we couldn't create one. do best effort
                if (TryGetReference(solution, projectReference, finalCompilation, VersionStamp.Default, out reference))
                {
                    // we have one from previous compilation!!, it might be out-of-date big time, but better than nothing.
                    // re-use it
                    return reference;
                }
            }

            // okay, proceed with whatever image we have

            // now, remove existing set
            var mapFromBranch = s_cache.GetValue(solution.BranchId, s_createReferenceSetMap);
            mapFromBranch.Remove(projectReference.ProjectId);

            // create new one
            var newReferenceSet = new MetadataOnlyReferenceSet(version, image);
            var referenceSet = s_snapshotCache.GetValue(finalCompilation, _ => newReferenceSet);
            if (newReferenceSet != referenceSet)
            {
                // someone else has beaten us. 
                // let image go eagerly. otherwise, finalizer in temporary storage will take care of it
                image.Cleanup();

                // return new reference
                return referenceSet.GetMetadataReference(finalCompilation, projectReference.Aliases, projectReference.EmbedInteropTypes);
            }

            // record it to version based cache as well. snapshot cache always has a higher priority. we don't need to check returned set here
            // since snapshot based cache will take care of same compilation for us.
            mapFromBranch.GetValue(projectReference.ProjectId, _ => referenceSet);

            // return new reference
            return referenceSet.GetMetadataReference(finalCompilation, projectReference.Aliases, projectReference.EmbedInteropTypes);
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:56,代码来源:MetadataOnlyReference.cs


示例20: Touch

        public void Touch(ProviderId providerId, Document document, VersionStamp version)
        {
            // only touch and updateMemberRange methods are allowed to update the dictionaries
            var data = _map.GetOrAdd(document.Id, s_createMap);

            lock (data)
            {
                Touch_NoLock(data, providerId, document, version);
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:10,代码来源:MemberRangeMap.cs



注:本文中的VersionStamp类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Vertex类代码示例发布时间:2022-05-24
下一篇:
C# VersionManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap