public static Assembly  compile(this string pathToFileToCompile, bool generateDebugSymbols)
        {
            PublicDI.CurrentScript = pathToFileToCompile;
            var csharpCompiler = new CSharp_FastCompiler().generateDebugSymbols(generateDebugSymbols);
            var compileProcess = new AutoResetEvent(false);

            csharpCompiler.set_OnCompileFail(() => compileProcess.Set());
            csharpCompiler.set_OnCompileOK(() => compileProcess.Set());

            O2Thread.mtaThread(() => csharpCompiler.compileSourceCode(pathToFileToCompile.contents()));
            compileProcess.WaitOne();
            return(csharpCompiler.assembly());
        }
Пример #2
0
        public static Assembly compile(this string pathToFileToCompile, bool generateDebugSymbols)
        {
            PublicDI.CurrentScript = pathToFileToCompile;
            var csharpCompiler = new CSharp_FastCompiler();

            csharpCompiler.generateDebugSymbols = generateDebugSymbols;
            var compileProcess = new System.Threading.AutoResetEvent(false);

            csharpCompiler.compileSourceCode(pathToFileToCompile.contents());
            csharpCompiler.onCompileFail = () => compileProcess.Set();
            csharpCompiler.onCompileOK   = () => compileProcess.Set();
            compileProcess.WaitOne();
            return(csharpCompiler.assembly());
        }