本文整理汇总了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;
}
示例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;
}
示例3: SyntaxTreeContextInfo
private SyntaxTreeContextInfo(VersionStamp version, int predefinedTypes, int predefinedOperators, ContainingNodes containingNodes) :
base(version)
{
_predefinedTypes = predefinedTypes;
_predefinedOperators = predefinedOperators;
_containingNodes = containingNodes;
}
示例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();
}
示例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();
}
示例6: CanReusePersistedSyntaxTreeVersion
public static bool CanReusePersistedSyntaxTreeVersion(this Document document, VersionStamp syntaxVersion, VersionStamp persistedVersion)
{
var canReuse = VersionStamp.CanReusePersistedVersion(syntaxVersion, persistedVersion);
PersistedVersionStampLogger.LogPersistedSyntaxTreeVersionUsage(canReuse);
return canReuse;
}
示例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;
}
示例8: CanReusePersistedDependentProjectVersion
public static bool CanReusePersistedDependentProjectVersion(this Project project, VersionStamp dependentProjectVersion, VersionStamp persistedVersion)
{
var canReuse = VersionStamp.CanReusePersistedVersion(dependentProjectVersion, persistedVersion);
PersistedVersionStampLogger.LogPersistedDependentProjectVersionUsage(canReuse);
return canReuse;
}
示例9: TryGetSerializationPrefixAndVersion
public bool TryGetSerializationPrefixAndVersion(Solution solution, string assemblyFilePath, out string prefix, out VersionStamp version)
{
prefix = string.Empty;
version = VersionStamp.Default;
return false;
}
示例10: CanReusePersistedTextVersion
public static bool CanReusePersistedTextVersion(this Document document, VersionStamp textVersion, VersionStamp persistedVersion)
{
var canReuse = VersionStamp.CanReusePersistedVersion(textVersion, persistedVersion);
PersistedVersionStampLogger.LogPersistedTextVersionUsage(canReuse);
return canReuse;
}
示例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;
}
示例12: NavigationBarModel
public NavigationBarModel(IList<NavigationBarItem> types, VersionStamp semanticVersionStamp, INavigationBarItemService itemService)
{
Contract.ThrowIfNull(types);
this.Types = types;
this.SemanticVersionStamp = semanticVersionStamp;
this.ItemService = itemService;
}
示例13: ProjectAnalysisData
public ProjectAnalysisData(ProjectId projectId, VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, AnalysisResult> result)
{
ProjectId = projectId;
Version = version;
Result = result;
OldResult = null;
}
示例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);
}
示例15: Create
public static TreeAndVersion Create(SyntaxTree tree, VersionStamp version)
{
if (tree == null)
{
throw new ArgumentNullException("tree");
}
return new TreeAndVersion(tree, version);
}