LoadAssembly() public method

This method walks the assembly's namespaces and name bindings to ScriptRuntime.Globals to represent the types available in the assembly. Each top-level namespace name gets bound in Globals to a dynamic object representing the namespace. Within each top-level namespace object, nested namespace names are bound to dynamic objects representing each tier of nested namespaces. When this method encounters the same namespace-qualified name, it merges names together objects representing the namespaces.
public LoadAssembly ( Assembly assembly ) : void
assembly System.Reflection.Assembly
return void
Beispiel #1
0
        private void loadRunTime()
        {
            m_output = new MemoryStream();
            m_runTime = ScriptRuntime.CreateFromConfiguration();

            m_runTime.IO.SetOutput(m_output, new StreamWriter(m_output));
            m_runTime.IO.SetErrorOutput(m_output, new StreamWriter(m_output));

            Assembly pluginsAssembly = Assembly.LoadFile(IO.IOHelper.MapPath(IO.SystemDirectories.Bin + "/umbraco.dll"));
            m_runTime.LoadAssembly(pluginsAssembly);

            m_runTime.LoadAssembly(typeof(String).Assembly);
            m_runTime.LoadAssembly(typeof(Uri).Assembly);
            m_runTime.LoadAssembly(typeof(umbraco.presentation.nodeFactory.Node).Assembly);
        }
Beispiel #2
0
        public AnalysisModule()
        {
            var t = Directory.GetCurrentDirectory();
            SourcePath = t + "\\Analysis";
            if (!Directory.Exists(SourcePath))
            {
                Directory.CreateDirectory(SourcePath);
            }

            ASRT = new ScriptRuntime(ScriptRuntimeSetup.ReadConfiguration(t+"\\NSCore.dll.config"));
            ASRT.LoadAssembly(Assembly.GetAssembly(typeof(IDevice)));
            ASRT.LoadAssembly(Assembly.GetAssembly(typeof(Marshal)));

            Scope = ASRT.CreateScope();
        }
Beispiel #3
0
        /// <summary>
        /// Initialize static scripting API objects
        /// </summary>
        static PyFilter()
        {
            _setup = ScriptRuntimeSetup.ReadConfiguration();
            _runtime = new ScriptRuntime(_setup);

            //make System and the current assembly availible to the scripts
            _runtime.LoadAssembly(Assembly.GetExecutingAssembly());
            _runtime.LoadAssembly(Assembly.GetAssembly(typeof(DateTime)));

            //assume default of App_Data/filters.py, but allow for overwriting
            string path = RootPath ?? HttpContext.Current.Server.MapPath("~/App_Data/");
            ScriptEngine engine = _runtime.GetEngine("IronPython");
            engine.SetSearchPaths(new string[] { path });
            engine.ExecuteFile(Path.Combine(path, ScriptFile ?? "filters.py"), _runtime.Globals);
        }
Beispiel #4
0
        public Page()
        {
            InitializeComponent();
            string code = @"
            def function(string):
            return string.upper()";

            ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null);
            setup.HostType = typeof(Microsoft.Scripting.Silverlight.BrowserScriptHost);
            setup.Options["SearchPaths"] = new string[] { string.Empty };

            ScriptRuntime runtime = new ScriptRuntime(setup);
            ScriptEngine pe = Python.GetEngine(runtime);

            // load platform assemblies so you don't need to call LoadAssembly in script code.
            foreach (string name in new string[] { "mscorlib", "System", "System.Windows", "System.Windows.Browser", "System.Net" })
            {
                runtime.LoadAssembly(runtime.Host.PlatformAdaptationLayer.LoadAssembly(name));
            }

            ScriptScope scope = pe.CreateScope();
            ScriptSource source = pe.CreateScriptSourceFromString(code, SourceCodeKind.Statements);
            source.Execute(scope);

            Func<string, string> func = scope.GetVariable<Func<string, string>>("function");

            string result = func("hello world!");
            textblock.Text = result;
        }
        private void startPythonEngine()
        {
            m_engine = Python.CreateEngine();
            m_runtime = m_engine.Runtime;
            m_scope = m_engine.CreateScope();

            m_runtime.LoadAssembly(GetType().Assembly);
        }
        public IronPythonScriptEngine()
        {
            runtime = engine.Runtime;
            runtime.LoadAssembly(Assembly.GetAssembly(typeof(Mogre.Vector3)));
            scope = runtime.CreateScope();

            // install built-in scripts
            install(new Script(builtin));
        }
        static PyControllerFactory()
        {
            _setup = ScriptRuntimeSetup.ReadConfiguration();
            _runtime = new ScriptRuntime(_setup);

            _runtime.LoadAssembly(Assembly.GetExecutingAssembly());

            string path = HttpContext.Current.Server.MapPath("~/App_Data/Controllers.py");
            _runtime.GetEngine("IronPython").ExecuteFile(path, _runtime.Globals);
        }
 /// <summary>
 /// Creates new instance of IPy engine with given stream
 /// </summary>
 /// <param name="iostream">stream object to be used for I/O</param>
 /// <remarks></remarks>
 public IPyEngine(System.IO.Stream iostream, bool AddExecutingAssembly = true)
 {
     this.Engine = Python.CreateEngine();
     Runtime = this.Engine.Runtime;
     EngineScope = this.Engine.CreateScope();
     _io = iostream;
     SetStreams(_io);
     if (AddExecutingAssembly)
     {
         Runtime.LoadAssembly(Assembly.GetExecutingAssembly());
     }
 }
Beispiel #9
0
        public object GetObject(string objectName)
        {
            Dictionary<string, object> instances = new Dictionary<string, object>();

            ScriptRuntimeSetup setup = ScriptRuntimeSetup.ReadConfiguration();
            ScriptRuntime runtime = new ScriptRuntime(setup);
            runtime.LoadAssembly(Assembly.GetExecutingAssembly());

            ScriptEngine engine = runtime.GetEngine("IronPython");
            runtime.Globals.SetVariable("instances", instances);
            engine.ExecuteFile("Objects.py", runtime.Globals);

            return instances[objectName];
        }
Beispiel #10
0
 public Engine(string filePath,Inventor.PlanarSketch oSketch,Inventor.Application oApp, double slotHeight, double slotWidth)
 {
     _engine = Python.CreateEngine(new Dictionary<string, object>() { {"Frames", true}, {"FullFrames", true}});
     _runtime = _engine.Runtime;
     Assembly invAssembly = Assembly.LoadFile(@"C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Autodesk.Inventor.Interop\v4.0_17.0.0.0__d84147f8b4276564\Autodesk.Inventor.interop.dll");
     _runtime.LoadAssembly(invAssembly);
     _scope = _engine.CreateScope();
     //Make variable names visible within the python file.  These string names will be used an arguments in the python file.
     _scope.SetVariable("oPlanarSketch",oSketch);
     _scope.SetVariable("oApp",oApp);
     _scope.SetVariable("slotHeight",slotHeight);
     _scope.SetVariable("slotWidth",slotWidth);
     ScriptSource _script = _engine.CreateScriptSourceFromFile(filePath);
     _code = _script.Compile();
 }
Beispiel #11
0
    private static void InitializeDLR(StreamResourceInfo xap, List<Assembly> assemblies) {
        DynamicApplication.XapFile = xap;

        var setup = DynamicApplication.CreateRuntimeSetup(assemblies);
        setup.DebugMode = true;
        var runtime = new ScriptRuntime(setup);
        
        // Load default silverlight assemblies for the script to have access to
        DynamicApplication.LoadDefaultAssemblies(runtime);

        // Load the assemblies into the runtime, giving the script access to them 
        assemblies.ForEach((a) => runtime.LoadAssembly(a));
        
        _engine = IronRuby.Ruby.GetEngine(runtime);
        _scope = _engine.CreateScope();
    }
Beispiel #12
0
        public DlrHost()
        {
            this._Runtime = new Lazy<ScriptRuntime>(() => {
                var setup = new ScriptRuntimeSetup();
                setup.DebugMode = true;

                setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));
                setup.AddRubySetup();

                var runtime = new ScriptRuntime(setup);
                AppDomain.CurrentDomain.GetAssemblies().ForEach(assm => runtime.LoadAssembly(assm));
                return runtime;
            });

            this._Scope = new Lazy<ScriptScope>(() => {
                var scope = this._Runtime.Value.CreateScope();
                return scope;
            });

            this._Extensions = new Lazy<ISet<string>>(() => {
                return new HashSet<string>(this._Runtime.Value.Setup.LanguageSetups.SelectMany(lang => lang.FileExtensions), StringComparer.OrdinalIgnoreCase);
            });
        }
Beispiel #13
0
        protected object ConstructObject(ContainedObject co)
        {
            if (_staticObjects.ContainsKey(co.Name)) {
                return _staticObjects[co.Name];
            } else {

                //in the full CodeVoyeur version, this is cached!
                ScriptRuntimeSetup setup = ScriptRuntimeSetup.ReadConfiguration();
                ScriptRuntime runtime = new ScriptRuntime(setup);
                runtime.LoadAssembly(Assembly.GetExecutingAssembly());

                ScriptScope scope = runtime.CreateScope("IronPython");
                ScriptSource source = scope.Engine.CreateScriptSourceFromString("from HostedIronPython.Model import *", SourceCodeKind.SingleStatement);
                source.Execute(scope);

                scope.SetVariable("instance", new object());

                scope.SetVariable("reference", new Func<string, object>
                    (
                        delegate(string refName) {
                            if (_staticObjects.ContainsKey(refName))
                                return _staticObjects[refName];
                            else
                                return GetFilling(refName);
                        }
                    ));

                ScriptSource configSource = scope.Engine.CreateScriptSourceFromString(co.Script, SourceCodeKind.Statements);
                configSource.Execute(scope);

                if (co.IsStatic)
                    return _staticObjects[co.Name] = scope.GetVariable("instance");
                else
                    return scope.GetVariable("instance");
            }
        }
Beispiel #14
0
        internal static void InitialiseScriptingEnvironment()
        {
            ScriptRuntimeSetup Setup = new ScriptRuntimeSetup();
            Setup.LanguageSetups.Add(IronRuby.Ruby.CreateRubySetup());
            Setup.LanguageSetups.Add(IronPython.Hosting.Python.CreateLanguageSetup(null));
            RunTime = new ScriptRuntime(Setup);
            Engine = RunTime.GetEngine("py");
            Scope = RunTime.CreateScope();

            RunTime.IO.SetOutput(ShellOutStream, Encoding.UTF8);
            RunTime.IO.SetErrorOutput(ShellOutStream, Encoding.UTF8);

            Assembly MainAssembly = Assembly.GetExecutingAssembly();
            string RootDir = Directory.GetParent(MainAssembly.Location).FullName;
            string HAGPath = Path.Combine(RootDir, "HtmlAgilityPack.dll");
            Assembly HAGAssembly = Assembly.LoadFile(HAGPath);

            RunTime.LoadAssembly(MainAssembly);
            RunTime.LoadAssembly(HAGAssembly);
            RunTime.LoadAssembly(typeof(String).Assembly);
            RunTime.LoadAssembly(typeof(Uri).Assembly);
            RunTime.LoadAssembly(typeof(XmlDocument).Assembly);

            Engine.Runtime.TryGetEngine("py", out Engine);
            List<string> PySearchPaths = new List<string>();
            foreach (string PyPath in PyPaths)
            {
                PySearchPaths.Add(PyPath.Replace("$ROOTDIR", RootDir));
            }
            try
            {
                Engine.SetSearchPaths(PySearchPaths);
            }
            catch(Exception Exp)
            {
                IronException.Report("Unable to set PyPaths", Exp.Message, Exp.StackTrace);
            }

            foreach (string PyCommand in PyCommands)
            {
                try
                {
                    ExecuteStartUpCommand(PyCommand);
                }
                catch(Exception Exp)
                {
                    IronException.Report("Unable to execute Python startup command - " + PyCommand, Exp.Message, Exp.StackTrace);
                }
            }

            Engine.Runtime.TryGetEngine("rb", out Engine);

            List<string> RbSearchPaths = new List<string>();

            foreach (string RbPath in RbPaths)
            {
                RbSearchPaths.Add(RbPath.Replace("$ROOTDIR", RootDir));
            }
            Engine.SetSearchPaths(RbSearchPaths);

            foreach (string RbCommand in RbCommands)
            {
                try
                {
                    ExecuteStartUpCommand(RbCommand);
                }
                catch (Exception Exp)
                {
                    IronException.Report("Unable to execute Ruby startup command" + RbCommand, Exp.Message, Exp.StackTrace);
                }
            }

            Engine.Runtime.TryGetEngine("py", out Engine);
            ExecuteStartUpCommand("print 123");
            ShellOutText = new StringBuilder();
            IronUI.ResetInteractiveShellResult();
        }
Beispiel #15
0
        public PythonObject(string[] args)
        {
            ScriptRuntimeSetup runtimeSetup = ScriptRuntimeSetup.ReadConfiguration();
            ConsoleHostOptions options = new ConsoleHostOptions();
            _optionsParser = new ConsoleHostOptionsParser(options, runtimeSetup);

            string provider = GetLanguageProvider(runtimeSetup);

            LanguageSetup languageSetup = null;
            foreach (LanguageSetup language in runtimeSetup.LanguageSetups) {
                if (language.TypeName == provider) {
                    languageSetup = language;
                }
            }
            if (languageSetup == null) {
                // the language doesn't have a setup -> create a default one:
                languageSetup = new LanguageSetup(Provider.AssemblyQualifiedName, Provider.Name);
                runtimeSetup.LanguageSetups.Add(languageSetup);
            }

            // inserts search paths for all languages (/paths option):
            InsertSearchPaths(runtimeSetup.Options, Options.SourceUnitSearchPaths);

            _languageOptionsParser = new OptionsParser<ConsoleOptions>();

            try {
                _languageOptionsParser.Parse(Options.IgnoredArgs.ToArray(), runtimeSetup, languageSetup, PlatformAdaptationLayer.Default);
            } catch (InvalidOptionException e) {
                Console.Error.WriteLine(e.Message);
            }

            _runtime = new ScriptRuntime(runtimeSetup);

            try {
                _engine = _runtime.GetEngineByTypeName(provider);
            } catch (Exception e) {
                Console.Error.WriteLine(e.Message);
            }
            _runtime.LoadAssembly(System.Reflection.Assembly.GetExecutingAssembly());
            _runtime.LoadAssembly(provider.GetType().Assembly);
            _runtime.LoadAssembly(PythonStringIO.StringIO().GetType().Assembly);
            _scope= _engine.CreateScope();
            RunCommandLine(args);
        }
 public static void LoadDefaultAssemblies(ScriptRuntime runtime) {
     // Add default references to Silverlight platform DLLs
     // (Currently we auto reference CoreCLR, UI controls, browser interop, and networking stack.)
     foreach (string name in new string[] { "mscorlib", "System", "System.Windows", "System.Windows.Browser", "System.Net" }) {
         runtime.LoadAssembly(GetAssemblyByName(name));
     }
 }
        private void InitializeDLR() {
            var setup = CreateRuntimeSetup();
            setup.DebugMode = _debug;
            setup.Options["SearchPaths"] = new string[] { String.Empty };
            
            _runtimeSetup = setup;
            _runtime = new ScriptRuntime(setup);

            _runtime.LoadAssembly(GetType().Assembly); // to expose our helper APIs
            LoadDefaultAssemblies(_runtime);
        }
Beispiel #18
0
        void InitRuntime(ScriptRuntime runtime)
        {
            runtime.IO.SetOutput(m_scriptOutputStream, System.Text.Encoding.Unicode);
            runtime.IO.SetErrorOutput(m_scriptOutputStream, System.Text.Encoding.Unicode);

            foreach (var assemblyName in new string[] { "Dwarrowdelf.Common", "Dwarrowdelf.Server.World" })
            {
                var assembly = runtime.Host.PlatformAdaptationLayer.LoadAssembly(assemblyName);
                runtime.LoadAssembly(assembly);
            }
        }
Beispiel #19
0
 /// <summary>
 /// Load default references into the runtime, including this assembly
 /// and a select set of platform assemblies.
 /// </summary>
 /// <param name="runtime">Pre-initialized ScriptRuntime to load assemblies into.</param>
 public static void LoadDefaultAssemblies(ScriptRuntime runtime) {
     foreach (string name in new string[] { "mscorlib", "System", "System.Windows", "System.Windows.Browser", "System.Net" }) {
         runtime.LoadAssembly(runtime.Host.PlatformAdaptationLayer.LoadAssembly(name));
     }
 }
Beispiel #20
0
        static EngineHelper()
        {
            // Add the App_Script folder to the path to allow script files to be imported from there
            string appPath = System.Web.HttpRuntime.AppDomainAppPath;
            s_scriptFolder = Path.Combine(appPath, ScriptFolderName);

            var setup = ScriptRuntimeSetup.ReadConfiguration();

            // Set the host type
            setup.HostType = typeof(WebScriptHost);

            setup.Options["SearchPaths"] = new string[] { s_scriptFolder };

            s_scriptEnvironment = new ScriptRuntime(setup);
            s_scriptEnvironment.LoadAssembly(typeof(ControlMembersInjector).Assembly);      // for our member injectors

            // Register for notifications when something in App_Script changes
            FileChangeNotifier.Register(s_scriptFolder, OnAppScriptFileChanged);

            List<string> fileExtensions = new List<string>();
            foreach (var language in s_scriptEnvironment.Setup.LanguageSetups) {
                fileExtensions.AddRange(language.FileExtensions);
            }
            s_fileExtensions = Array.ConvertAll(fileExtensions.ToArray(), e => e.ToLower());

            List<string> simpleNames = new List<string>();
            foreach (var language in s_scriptEnvironment.Setup.LanguageSetups) {
                simpleNames.AddRange(language.Names);
            }
            s_languageIds = Array.ConvertAll(simpleNames.ToArray(), n => n.ToLower());
        }
 static RouteManager()
 {
     _setup = ScriptRuntimeSetup.ReadConfiguration();
     _runtime = new ScriptRuntime(_setup);
     _runtime.LoadAssembly(Assembly.GetExecutingAssembly());
 }
        private void InitIronPython()
        {
            if (m_engine == null)
            {
                //s_engine = Python.CreateEngine();
                //s_runtime = s_engine.Runtime;
                // s_scope = s_engine.CreateScope();

                m_runtime = Python.CreateRuntime();
                m_runtime.LoadAssembly(typeof(String).Assembly);
                //runtime.LoadAssembly(typeof(Uri).Assembly);

                // no module name System
                //m_runtime.ImportModule("System");

                m_scope = m_runtime.CreateScope();

                m_engine = Python.GetEngine(m_runtime);

                ICollection<string> paths = m_engine.GetSearchPaths();
                foreach (string s in s_pythonLibPath)
                {
                    paths.Add(s);
                }
                m_engine.SetSearchPaths(paths);
            }
        }
        public void ReloadScripts(ScriptExecutionCallback scriptExecutionCallback)
        {
            Shutdown();

            ScriptRuntimeSetup scriptRuntimeSetup = new ScriptRuntimeSetup();
            scriptRuntimeSetup.LanguageSetups.Add(new LanguageSetup("IronPython.Runtime.PythonContext, IronPython", "IronPython 2.6", new[] { "IronPython", "Python", "py" }, new[] { ".py" }));
            scriptRuntimeSetup.LanguageSetups.Add(new LanguageSetup("IronRuby.Runtime.RubyContext, IronRuby", "IronRuby 1.0", new[] { "IronRuby", "Ruby", "rb" }, new[] { ".rb" }));
            scriptRuntimeSetup.LanguageSetups[0].Options.Add("SearchPaths", @"Libraries\IronPython".Split(';'));
            scriptRuntimeSetup.LanguageSetups[1].Options.Add("SearchPaths", @"Libraries\IronRuby\IronRuby;Libraries\IronRuby\ruby;Libraries\IronRuby\ruby\site_ruby;Libraries\IronRuby\ruby\site_ruby\1.8;Libraries\IronRuby\ruby\1.8".Split(';'));
            scriptRuntimeSetup.LanguageSetups[1].Options.Add("LibraryPaths", @"Libraries\IronRuby\IronRuby;Libraries\IronRuby\ruby;Libraries\IronRuby\ruby\site_ruby;Libraries\IronRuby\ruby\site_ruby\1.8;Libraries\IronRuby\ruby\1.8".Split(';'));
            scriptRuntimeSetup.LanguageSetups[1].Options["KCode"] = RubyEncoding.KCodeUTF8;
            scriptRuntimeSetup.LanguageSetups[1].ExceptionDetail = true;
            _scriptRuntime = ScriptRuntime.CreateRemote(AppDomain.CurrentDomain, scriptRuntimeSetup);

            foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
                _scriptRuntime.LoadAssembly(asm);

            _scriptScopes = new Dictionary<string, ScriptScope>();
            PrepareScriptScopeByPath("*Eval*");
            _scriptRuntime.Globals.SetVariable("Session", _sessionProxy.GetTransparentProxy());
            _scriptRuntime.Globals.SetVariable("Server", _serverProxy.GetTransparentProxy());
            _scriptRuntime.Globals.SetVariable("CurrentSession", _sessionProxy.GetTransparentProxy());
            _scriptRuntime.Globals.SetVariable("CurrentServer", _serverProxy.GetTransparentProxy());

            // 共通のスクリプトを読む
            LoadScriptsFromDirectory(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "GlobalScripts"), scriptExecutionCallback);

            // ユーザごとのスクリプトを読む
            LoadScriptsFromDirectory(Path.Combine(CurrentSession.UserConfigDirectory, "Scripts"), scriptExecutionCallback);
        }
Beispiel #24
0
        static ScriptEngine GetScriptEngine()
        {
            ScriptRuntimeSetup Setup = new ScriptRuntimeSetup();
            Setup.LanguageSetups.Add(IronRuby.Ruby.CreateRubySetup());
            Setup.LanguageSetups.Add(IronPython.Hosting.Python.CreateLanguageSetup(null));
            ScriptRuntime RunTime = new ScriptRuntime(Setup);
            ScriptEngine Engine = RunTime.GetEngine("py");
            ScriptScope Scope = RunTime.CreateScope();

            Assembly MainAssembly = Assembly.GetExecutingAssembly();
            string RootDir = Directory.GetParent(MainAssembly.Location).FullName;

            RunTime.LoadAssembly(MainAssembly);
            RunTime.LoadAssembly(typeof(String).Assembly);
            RunTime.LoadAssembly(typeof(Uri).Assembly);
            RunTime.LoadAssembly(typeof(XmlDocument).Assembly);

            Engine.Runtime.TryGetEngine("py", out Engine);
            return Engine;
        }
Beispiel #25
0
        private void InitializeDLR(ScriptRuntimeSetup setup) {
            setup.HostType = typeof(BrowserScriptHost);
            setup.DebugMode = _debug;

            setup.Options["SearchPaths"] = new string[] { String.Empty };
            
            _runtimeSetup = setup;
            _runtime = new ScriptRuntime(setup);

            _runtime.LoadAssembly(GetType().Assembly); // to expose our helper APIs

            // Add default references to Silverlight platform DLLs
            // (Currently we auto reference CoreCLR, UI controls, browser interop, and networking stack.)
            foreach (string name in new string[] { "mscorlib", "System", "System.Windows", "System.Windows.Browser", "System.Net" }) {
                _runtime.LoadAssembly(BrowserPAL.PAL.LoadAssembly(name));
            }
        }
Beispiel #26
0
        private static void LoadReferencedAssembliesIntoEnvironment(ScriptRuntime environment)
        {
            // Make sure we're running with a System.Web.dll that has the new API's we need
            UI.NoCompileCodePageParserFilter.CheckCorrectSystemWebSupport();

            // Call BuildManager.GetReferencedAssemblies(), either the one that returns an array or an ICollection,
            // depending on what's available.
            // TODO: this is a temporary workaround for bug VSWhidbey 607089.  Once fix, we should always call
            // the one that returns an ICollection.
            ICollection referencedAssemblies = null;
            GetReferencedAssembliesReturnCollection getReferencedAssembliesCollection =
                (GetReferencedAssembliesReturnCollection)GetGetReferencedAssembliesDelegate(
                    typeof(GetReferencedAssembliesReturnCollection));
            if (getReferencedAssembliesCollection != null) {
                referencedAssemblies = getReferencedAssembliesCollection();
            } else {
                GetReferencedAssembliesReturnArray getReferencedAssembliesArray =
                    (GetReferencedAssembliesReturnArray)GetGetReferencedAssembliesDelegate(
                        typeof(GetReferencedAssembliesReturnArray));
                Debug.Assert(getReferencedAssembliesArray != null);
                if (getReferencedAssembliesArray != null) {
                    referencedAssemblies = getReferencedAssembliesArray();
                }
            }

            if (referencedAssemblies != null) {
                // Load all the BuildManager assemblies into the engine
                foreach (Assembly a in referencedAssemblies) {
                    environment.LoadAssembly(a);
                }
            }
        }
Beispiel #27
0
 public PythonPluginLoader() {
     ironPythonEngine = IronPython.Hosting.Python.CreateEngine();
     ironPythonRuntime = ironPythonEngine.Runtime;
     ironPythonRuntime.LoadAssembly( typeof( Server ).Assembly );
 }