Example #1
0
        private void Load()
        {
            Controller = new TypeSystemController(this);

            LinkerModule = Controller.CreateModule();
            using (var module = Controller.MutateModule(LinkerModule))
            {
                module.Name              = "@Linker";
                module.Assembly          = "@Linker";
                module.IsLinkerGenerated = true;
            }
            Modules.Add(LinkerModule);

            DefaultLinkerType = Controller.CreateType();
            using (var type = Controller.MutateType(DefaultLinkerType))
            {
                type.Module            = LinkerModule;
                type.Name              = "Default";
                type.IsLinkerGenerated = true;
                type.TypeCode          = MosaTypeCode.ReferenceType;
            }
            Controller.AddType(DefaultLinkerType);

            metadata.Initialize(this, Controller);
            metadata.LoadMetadata();

            if (CorLib == null)
            {
                throw new AssemblyLoadException();
            }
        }
 public void Initialize(TypeSystem system, ITypeSystemController controller)
 {
     TypeSystem = system;
     Controller = controller;
     Cache      = new MetadataCache();
     Loader     = new MetadataLoader(this);
     Resolver   = new MetadataResolver(this);
 }
Example #3
0
 public void Initialize(TypeSystem system, ITypeSystemController controller)
 {
     TypeSystem = system;
     Controller = controller;
     Cache = new MetadataCache();
     Loader = new MetadataLoader(this);
     Resolver = new MetadataResolver(this);
 }
Example #4
0
        private void Load()
        {
            Controller = new TypeSystemController(this);

            LinkerModule = Controller.CreateModule();
            using (var module = Controller.MutateModule(LinkerModule))
            {
                module.Name = "@Linker";
                module.Assembly = "@Linker";
                module.IsLinkerGenerated = true;
            }
            Modules.Add(LinkerModule);

            DefaultLinkerType = Controller.CreateType();
            using (var type = Controller.MutateType(DefaultLinkerType))
            {
                type.Module = LinkerModule;
                type.Name = "Default";
                type.IsLinkerGenerated = true;
                type.TypeCode = MosaTypeCode.ReferenceType;
            }
            Controller.AddType(DefaultLinkerType);

            metadata.Initialize(this, Controller);
            metadata.LoadMetadata();

            if (CorLib == null)
                throw new AssemblyLoadException();
        }