当前位置: 首页>>代码示例>>C#>>正文


C# VersionStamp类代码示例

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


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


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