private PEModuleSymbol(AssemblySymbol assemblySymbol, PEModule module, MetadataImportOptions importOptions, int ordinal) { Debug.Assert((object)assemblySymbol != null); Debug.Assert(module != null); _assemblySymbol = assemblySymbol; _ordinal = ordinal; _module = module; this.ImportOptions = importOptions; _globalNamespace = new PEGlobalNamespaceSymbol(this); this.MetadataLocation = ImmutableArray.Create <MetadataLocation>(new MetadataLocation(this)); }
/// <summary> /// Constructor. /// </summary> /// <param name="name"> /// Name of the namespace, must be not empty. /// </param> /// <param name="containingNamespace"> /// Containing namespace. /// </param> /// <param name="typesByNS"> /// The sequence of groups of TypeDef row ids for types contained within the namespace, /// recursively including those from nested namespaces. The row ids are grouped by the /// fully-qualified namespace name case-sensitively. There could be multiple groups /// for each fully-qualified namespace name. The groups are sorted by their /// key in case-sensitive manner. Empty string is used as namespace name for types /// immediately contained within Global namespace. Therefore, all types in this namespace, if any, /// will be in several first IGroupings. /// </param> internal PENestedNamespaceSymbol( string name, PENamespaceSymbol containingNamespace, IEnumerable<IGrouping<string, TypeDefinitionHandle>> typesByNS) { Debug.Assert(name != null && name.Length > 0); Debug.Assert((object)containingNamespace != null); Debug.Assert(typesByNS != null); _containingNamespaceSymbol = containingNamespace; _name = name; _typesByNS = typesByNS; }
/// <summary> /// Constructor. /// </summary> /// <param name="name"> /// Name of the namespace, must be not empty. /// </param> /// <param name="containingNamespace"> /// Containing namespace. /// </param> /// <param name="typesByNS"> /// The sequence of groups of TypeDef row ids for types contained within the namespace, /// recursively including those from nested namespaces. The row ids are grouped by the /// fully-qualified namespace name case-sensitively. There could be multiple groups /// for each fully-qualified namespace name. The groups are sorted by their /// key in case-sensitive manner. Empty string is used as namespace name for types /// immediately contained within Global namespace. Therefore, all types in this namespace, if any, /// will be in several first IGroupings. /// </param> internal PENestedNamespaceSymbol( string name, PENamespaceSymbol containingNamespace, IEnumerable <IGrouping <string, TypeDefinitionHandle> > typesByNS) { Debug.Assert(name != null && name.Length > 0); Debug.Assert((object)containingNamespace != null); Debug.Assert(typesByNS != null); _containingNamespaceSymbol = containingNamespace; _name = name; _typesByNS = typesByNS; }
internal NamedTypeSymbol LookupTopLevelMetadataType(ref MetadataTypeName emittedName, out bool isNoPiaLocalType) { NamedTypeSymbol result; PENamespaceSymbol scope = (PENamespaceSymbol)this.GlobalNamespace.LookupNestedNamespace(emittedName.NamespaceSegments); if ((object)scope == null) { // We failed to locate the namespace isNoPiaLocalType = false; result = new MissingMetadataTypeSymbol.TopLevel(this, ref emittedName); } else { result = scope.LookupMetadataType(ref emittedName, out isNoPiaLocalType); Debug.Assert((object)result != null); } return(result); }
private PEModuleSymbol(AssemblySymbol assemblySymbol, PEModule module, MetadataImportOptions importOptions, int ordinal) { Debug.Assert((object)assemblySymbol != null); Debug.Assert(module != null); _assemblySymbol = assemblySymbol; _ordinal = ordinal; _module = module; this.ImportOptions = importOptions; _globalNamespace = new PEGlobalNamespaceSymbol(this); this.MetadataLocation = ImmutableArray.Create<MetadataLocation>(new MetadataLocation(this)); }