internal PEModuleSymbol( PEAssemblySymbol assemblySymbol, PEModule module, MetadataImportOptions importOptions, int ordinal ) : this((AssemblySymbol)assemblySymbol, module, importOptions, ordinal) { Debug.Assert(ordinal >= 0); }
private void AppendAssemblyRefs(StringBuilder result, PEAssemblySymbol assembly) { foreach (var a in assembly.PrimaryModule.GetReferencedAssemblies()) { result.Append(".assembly extern "); result.AppendLine(a.GetDisplayName(fullKey: true)); } }
internal PEModuleSymbol(PEAssemblySymbol assemblySymbol, PEModule module, MetadataImportOptions importOptions, int ordinal) : this((AssemblySymbol)assemblySymbol, module, importOptions, ordinal) { Debug.Assert(ordinal >= 0); }
/// <summary> /// </summary> /// <param name="assemblySymbol"> /// </param> private void SetCorLib(PEAssemblySymbol assemblySymbol) { if (!assemblySymbol.Assembly.AssemblyReferences.Any()) { // this is the core lib assemblySymbol.SetCorLibrary(assemblySymbol); return; } var loadedRefAssemblies = from assemblyIdentity in assemblySymbol.Assembly.AssemblyReferences select this.LoadAssemblySymbol(assemblyIdentity); foreach (var loadedRefAssemblySymbol in loadedRefAssemblies) { var peRefAssembly = loadedRefAssemblySymbol as PEAssemblySymbol; if (peRefAssembly != null && !peRefAssembly.Assembly.AssemblyReferences.Any()) { assemblySymbol.SetCorLibrary(loadedRefAssemblySymbol); return; } } Debug.Fail("CoreLib not set"); }
/// <summary> /// </summary> /// <param name="assemblySymbol"> /// </param> /// <returns> /// </returns> private IEnumerable<IType> EnumAllTypes(PEAssemblySymbol assemblySymbol) { Debug.Assert(assemblySymbol != null, "missing assembly"); foreach (var module in assemblySymbol.Modules) { var peModuleSymbol = module as PEModuleSymbol; foreach ( var metadataTypeAdapter in from symbol in GetAllNamespaces(peModuleSymbol.GlobalNamespace).SelectMany(n => n.GetTypeMembers()) select new MetadataTypeAdapter(symbol)) { yield return metadataTypeAdapter; foreach (var nestedType in EnumAllNestedTypes(metadataTypeAdapter)) { yield return nestedType; } } } }