Пример #1
0
        unsafe public void Compile()
        {
            try
            {
                scriptLanguage = new SexyScriptLanguage(Logger.Log, RouteSysMessages);
                scriptLanguage.EvTerminated += OnScriptLanguageTerminated;

                foreach (string key in Files.Keys)
                {
                    Files[key].Module = scriptLanguage.AddModule(key);
                }

                if (EvCompiling != null)
                {
                    EvCompiling();
                }
                scriptLanguage.Compile();
                isCompiled = true;
                if (EvCompiled != null)
                {
                    EvCompiled();
                }
            }
            catch (CompileError cex)
            {
                var errBox = new ExceptionWindow();
                errBox.SetException(cex);
                errBox.ShowDialog();

                scriptLanguage = null;
            }
            catch (Exception ex)
            {
                var errBox = new ExceptionWindow();
                errBox.SetException(ex);
                errBox.ShowDialog();

                scriptLanguage = null;
            }
        }
Пример #2
0
        public static void ShowException(Exception ex, Controller controller)
        {
            if (ex is SexyDotNet.Host.CompileError)
            {
                var ce         = ex as SexyDotNet.Host.CompileError;
                var compileBox = new CompileWindow();
                compileBox.SetSource(ce.SourceFile);
                compileBox.SetText(ex.Message);
                compileBox.SetSourceLocation(ce.Start, ce.End);
                compileBox.ShowDialog();

                if (controller != null)
                {
                    controller.SetEmphasis(ce);
                }
            }
            else
            {
                var errBox = new ExceptionWindow();
                errBox.SetException(ex);
                errBox.ShowDialog();
            }
        }