Exemple #1
0
        private static void CreateWorld()
        {
            _world = new HostedScriptEngine();
            var thisAsm = System.Reflection.Assembly.GetExecutingAssembly();
            var asmDir  = Path.GetDirectoryName(thisAsm.Location);
            var libDir  = Path.Combine(asmDir, "lib");

            if (Directory.Exists(libDir))
            {
                _world.InitExternalLibraries(libDir, new string[0]);
            }

            _world.SetGlobalEnvironment(new ConsoleHost(), null);
            _world.AttachAssembly(thisAsm);
            _world.Initialize();
        }