本文整理汇总了C#中ImmutableArray.SetEquals方法的典型用法代码示例。如果您正苦于以下问题:C# ImmutableArray.SetEquals方法的具体用法?C# ImmutableArray.SetEquals怎么用?C# ImmutableArray.SetEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImmutableArray
的用法示例。
在下文中一共展示了ImmutableArray.SetEquals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: State
internal State(
ImmutableArray<SyntaxTree> syntaxTrees,
ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap,
ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap,
ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap,
ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> rootNamespaces,
DeclarationTable declarationTable)
{
Debug.Assert(syntaxTrees.All(tree => syntaxTrees[syntaxTreeOrdinalMap[tree]] == tree));
Debug.Assert(syntaxTrees.SetEquals(rootNamespaces.Keys.AsImmutable(), EqualityComparer<SyntaxTree>.Default));
this.SyntaxTrees = syntaxTrees;
this.OrdinalMap = syntaxTreeOrdinalMap;
this.LoadDirectiveMap = loadDirectiveMap;
this.LoadedSyntaxTreeMap = loadedSyntaxTreeMap;
this.RootNamespaces = rootNamespaces;
this.DeclarationTable = declarationTable;
}
示例2: CSharpCompilation
private CSharpCompilation(
string assemblyName,
CSharpCompilationOptions options,
ImmutableArray<MetadataReference> references,
ImmutableArray<SyntaxTree> syntaxTrees,
ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap,
ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> rootNamespaces,
DeclarationTable declarationTable,
CSharpCompilation previousSubmission,
Type submissionReturnType,
Type hostObjectType,
bool isSubmission,
ReferenceManager referenceManager,
bool reuseReferenceManager,
AsyncQueue<CompilationEvent> eventQueue = null)
: base(assemblyName, references, submissionReturnType, hostObjectType, isSubmission, syntaxTreeOrdinalMap, eventQueue)
{
using (Logger.LogBlock(FunctionId.CSharp_Compilation_Create, message: assemblyName))
{
this.wellKnownMemberSignatureComparer = new WellKnownMembersSignatureComparer(this);
this.options = options;
this.syntaxTrees = syntaxTrees;
this.rootNamespaces = rootNamespaces;
this.declarationTable = declarationTable;
Debug.Assert(syntaxTrees.All(tree => syntaxTrees[syntaxTreeOrdinalMap[tree]] == tree));
Debug.Assert(syntaxTrees.SetEquals(rootNamespaces.Keys.AsImmutable(), EqualityComparer<SyntaxTree>.Default));
this.builtInOperators = new BuiltInOperators(this);
this.scriptClass = new Lazy<ImplicitNamedTypeSymbol>(BindScriptClass);
this.globalImports = new Lazy<Imports>(BindGlobalUsings);
this.globalNamespaceAlias = new Lazy<AliasSymbol>(CreateGlobalNamespaceAlias);
this.anonymousTypeManager = new AnonymousTypeManager(this);
if (isSubmission)
{
Debug.Assert(previousSubmission == null || previousSubmission.HostObjectType == hostObjectType);
this.previousSubmission = previousSubmission;
}
else
{
Debug.Assert(previousSubmission == null && submissionReturnType == null && hostObjectType == null);
}
if (reuseReferenceManager)
{
referenceManager.AssertCanReuseForCompilation(this);
this.referenceManager = referenceManager;
}
else
{
this.referenceManager = new ReferenceManager(
MakeSourceAssemblySimpleName(),
options.AssemblyIdentityComparer,
(referenceManager != null) ? referenceManager.ObservedMetadata : null);
}
Debug.Assert((object)this.lazyAssemblySymbol == null);
if (EventQueue != null) EventQueue.Enqueue(new CompilationStartedEvent(this));
}
}
示例3: ValidateMemberDiagnostics
private void ValidateMemberDiagnostics(DiagnosticAnalyzer analyzer, Document document, SyntaxNode root, ImmutableArray<DiagnosticData> diagnostics)
{
#if RANGE
var documentBasedDriver = new DiagnosticAnalyzerDriver(document, root.FullSpan, root, this, CancellationToken.None);
var expected = GetSemanticDiagnosticsAsync(documentBasedDriver, analyzer).WaitAndGetResult(documentBasedDriver.CancellationToken) ?? SpecializedCollections.EmptyEnumerable<DiagnosticData>();
Contract.Requires(diagnostics.SetEquals(expected));
#endif
}