Ejemplo n.º 1
0
        /// <summary>
        ///    Loads the given assembly and exposes the API to the user.
        /// </summary>
        public void LoadAssembly(string file)
        {
            var loader   = new DynamicLoader(importer, ctx);
            var assembly = loader.LoadAssemblyFile(file, false);

            if (assembly == null)
            {
                return;
            }

            lock (evaluator_lock){
                importer.ImportAssembly(assembly, module.GlobalRootNamespace);
            }
        }
Ejemplo n.º 2
0
        public override void LoadReferences(ModuleContainer module)
        {
            Assembly corlib;
            List <Tuple <RootNamespace, Assembly> > loaded;

            base.LoadReferencesCore(module, out corlib, out loaded);

            if (corlib == null)
            {
                return;
            }

            importer.ImportAssembly(corlib, module.GlobalRootNamespace);
            foreach (var entry in loaded)
            {
                importer.ImportAssembly(entry.Item2, entry.Item1);
            }
        }