示例#1
0
        public static async Task CompileAndRun(string Code, JSObject compileLog, JSObject outputLog)
        {
            try
            {
                service.CompileLog = new List <string>();
                var result = await service.CompileAndRun(Code);

                outputLog.SetObjectProperty("innerText", string.Join("\r\n", result));
            }
            catch (Exception e)
            {
                service.CompileLog.Add(e.Message);
                service.CompileLog.Add(e.StackTrace);
                throw;
            }
            finally
            {
                compileLog.SetObjectProperty("innerText", string.Join("\r\n", service.CompileLog));
            }
        }
示例#2
0
        public static async Task CompileAndRun(JSObject app, string code)
        {
            try
            {
                service.CompileLog = new List <string>();
                var result = await service.CompileAndRun(code);

                app.Invoke("setRunLog", new object[] { string.Join("\r\n", result) });
            }
            catch (Exception e)
            {
                service.CompileLog.Add(e.Message);
                service.CompileLog.Add(e.StackTrace);
                throw;
            }
            finally
            {
                app.Invoke("setCompileLog", new object[] { string.Join("\r\n", service.CompileLog) });
            }
        }