Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="underlyingAssembly">
        /// The underlying AssemblySymbol, cannot be an instance of CSharpAssemblySymbol.
        /// </param>
        internal CSharpAssemblySymbol(CSharpSymbols.AssemblySymbol underlyingAssembly)
        {
            Debug.Assert((object)underlyingAssembly != null);

            _underlyingAssembly = underlyingAssembly;

            ModuleSymbol[] modules = new CSharpModuleSymbol[underlyingAssembly.Modules.Length];

            modules[0] = new CSharpModuleSymbol(this, underlyingAssembly.Modules[0], 0);

            for (int i = 1; i < underlyingAssembly.Modules.Length; i++)
            {
                PEModuleSymbol under = (PEModuleSymbol)underlyingAssembly.Modules[i];
                modules[i] = new CSharpModuleSymbol(this, new PEModuleSymbol((PEAssemblySymbol)this._underlyingAssembly, under.Module, under.ImportOptions, i), i);
            }

            _modules = modules.AsImmutableOrNull();

            foreach (var module in _modules)
            {
                CSharpSymbolMap.RegisterModuleSymbol((CSharpModuleSymbol)module);
            }
        }
 public CSharpModuleSymbol RegisterModuleSymbol(CSharpModuleSymbol moduleSymbol)
 {
     map.Add(moduleSymbol.CSharpModule, moduleSymbol);
     return(moduleSymbol);
 }