Example #1
0
        /// <summary>
        /// Find the  existent output window by program name. If none exists, create a new one
        /// </summary>
        /// <param name="programName"></param>
        /// <returns></returns>
        private frmOutput GetOutputWindow(string programName)
        {
            if (outputWindows_.Keys.Contains(programName))
            {
                return(outputWindows_[programName]);
            }

            frmOutput output = new frmOutput();

            output.MdiParent = this;
            output.Show();
            output.Left = this.Width - output.Width - 35;
            output.Top  = 0;
            output.Initialize(programName);
            outputWindows_.Add(programName, output);
            output.FormClosed += new FormClosedEventHandler(output_FormClosed);
            return(output);
        }
Example #2
0
        /// <summary>
        /// Runs the program in the active editor window
        /// </summary>
        private void Run()
        {
            if (activeEditor_ == null)
            {
                MessageBox.Show("No active editor found!", "SIL Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            SIL_Program program = new SIL_Program();

            program.Name = activeEditor_.ProgramName;
            program.Text = activeEditor_.ProgramText;

            //Get output and error windows
            frmOutput output = GetOutputWindow(program.Name);

            output.Clear();
            frmErrList errors = GetErrorWindow(program.Name);

            errors.Clear();

            //Execute the program in these widnows
            output.ExecuteProgram(program, errors);
        }