Example #1
0
        private void OptionBox_Load(object sender, EventArgs e)
        {
            ScriptContext context = EditorAppContext.GetScriptContext();

            directoryList.Items.AddRange(context.SearchPath);
            assemblyList.Items.AddRange(context.References);
        }
Example #2
0
        private void runToolStripMenuItem_Click(object sender, EventArgs e)
        {
            /****************************************************************************
             * Parses the script and then runs it.
             * *************************************************************************/
            if (!(Saved || string.IsNullOrEmpty(filePath)))
            {
                Save(filePath);
            }

            try
            {
                ClearErrors();
                Hide();
                Console.Clear();
                Console.Title = Text;

                var context = EditorAppContext.GetScriptContext();

                if (Saved & sciEditor.TextLength > 0)
                {
                    ScriptEngine.ExecuteFile(filePath, context);
                }
                else
                {
                    ScriptEngine.ExecuteString(sciEditor.Text, context);
                }
            }
            catch (ScriptException ex)
            {
                ReportError(ex);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                Console.Read();
            }
            finally
            {
                Console.Title += " [Done]";
                Show();
                Activate();
            }
        }