Ejemplo n.º 1
0
        private void runMainToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var frmMain = new frmMain();

            frmMain.Show();
            frmMain.Activate();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Event handler for processing when the another application instance tries
        ///   to startup. Bring the previous instance of the app to the front and
        ///   process any command-line that's needed.
        /// </summary>
        /// <param name = "sender">Object sending this message.</param>
        /// <param name = "e">Event argument for this message.</param>
        private static void OnAppStartupNextInstance(object sender, StartupNextInstanceEventArgs e)
        {
            // if the window is currently minimized, then restore it.
            if (_mainForm.WindowState == FormWindowState.Minimized)
            {
                _mainForm.WindowState = FormWindowState.Normal;
            }

            // activate the current instance of the app, so that it's shown.
            _mainForm.Activate();
        }
Ejemplo n.º 3
0
 void Show()
 {
     // If we are already showing the window, merely focus it.
     if (mainForm.Visible)
     {
         mainForm.Activate();
     }
     else
     {
         mainForm.Show();
         mainForm.WindowState = FormWindowState.Normal;
     }
 }
Ejemplo n.º 4
0
 private void TimerEventProcessorFirstDoc(object source, System.Timers.ElapsedEventArgs e)
 {
     timerFirstDoc.Enabled = false;
     SetVisible(false);
     if (mainApplication.InvokeRequired)
     {
         ActivateCallback callback = new ActivateCallback(mainApplication.Activate);
         this.Invoke(callback, new object[] { });
     }
     else
     {
         mainApplication.Activate();
     }
 }
 private void openTask(object sender, EventArgs e)
 {
     frmMain_Parent.Activate();
     frmMain_Parent.tabMain.SelectedIndex = 5;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Main program loop. Maintains the running program.
        /// When in debug mode, it returns when it reachs break-point.
        /// In normal mode the program is the main loop of a thread, so it has infinite loop.
        /// </summary>
        public void Run()
        {
            try
            {
                while (!bConsoleClosed)
                {
                    // Break-point?
                    if (bInDebug)
                    {
                        if ((_BreakPointList.ContainsPC(theSimulator.R[15])) || (bStepIn))
                        {
                            UpdateDebugViews();

                            if (OnBreakPoint != null)
                            {
                                OnBreakPoint(this, theSimulator.R[15], null);
                            }
                            BreakPointWait.WaitOne();
                        }
                    }

                    // Perform next command
                    theSimulator.PerformNextCommand();
                    Thread.Sleep(0);
                }
            }
            catch (RuntimeError e)
            {
                // Make sure that the output thread will be closed. (We hope)
                theSimulator.OutputThreadOn = false;

                if (e.ErrorCode == SimulatorMessage.CONSOLE_EXIT)
                {
                    return;
                }

                // Display message
                string s;
                if (e.ErrorCode == SimulatorMessage.NORMAL_EXIT)
                {
                    if (e.ExtraInformation == 0)
                    {
                        s = "\nProgram ended successfully. Press any key...";
                    }
                    else
                    {
                        s = "\nProgram ended with errorcode " + e.ExtraInformation + ". Press any key...";
                    }
                }
                else if (e.ErrorCode == SimulatorMessage.SYSTEM_HALTED)
                {
                    s = "\n" + SimulatorMessagesStrings.GetMessageText(e.ErrorCode, e.ExtraInformation) + ". Press any key...";
                }
                // ILLEGAL_EXIT occurs when we write on the console, when it already has disposed
                else
                {
                    s = "\nRuntime Error: " + SimulatorMessagesStrings.GetMessageText(e.ErrorCode, e.ExtraInformation) + ". Press any key...";

                    if (Settings.Simulator.bShowDebugInformation)
                    {
                        s += GenerateDebugInformation(e);
                    }
                }
                try
                {
                    con.Invoke(theSimulator.Console.m_Output, new object[] { (CodeBlock)s });
                }
                catch (VAX11Simulator.RuntimeError)
                {
                }

                if (bInDebug)
                {
                    UpdateDebugViews();
                }

                theSimulator.Console.exitConsole(true);

                // Must be so ugly cuz of c# stupid components threading policy
                if (bInDebug)
                {
                    _theMainApplication.Invoke(new ProgramEndHandler(_theMainApplication.InterfaceDoRestartDebuggedProgram), new object[] { s });
                }

                _theMainApplication.Activate();
            }
        }
Ejemplo n.º 7
0
 private void application_OnPluginCommand(string cID)
 {
     if (cID == CommandID)
     {
         if (frm_Main == null || !frm_Main.Created)
         {
             frm_Main = new frmMain(application);
             frm_Main.Show();
         }
         else
         {
             frm_Main.Activate();
         }
     }
     else if (cID == CommandID_TOJPG)
     {
         if (frm_ToJPG == null || !frm_ToJPG.Created)
         {
             frm_ToJPG = new frmToJPG(application);
             frm_ToJPG.Show();
         }
         else
         {
             frm_ToJPG.Activate();
         }
     }
     else if (cID == CommandID_COLORCHANGE)
     {
         if (frm_ColorReplace == null || !frm_ColorReplace.Created)
         {
             frm_ColorReplace = new frmColorReplace(application);
             frm_ColorReplace.Show();
         }
         else
         {
             frm_ColorReplace.Activate();
         }
     }
     else if (cID == CommandID_COMPRESSTEXT)
     {
         if (frm_CompressText == null || !frm_CompressText.Created)
         {
             frm_CompressText = new frmCompressText(application);
             frm_CompressText.Show();
         }
         else
         {
             frm_CompressText.Activate();
         }
     }
     else if (cID == CommandID_CONVERTTO)
     {
         if (frm_ConvertTo == null || !frm_ConvertTo.Created)
         {
             frm_ConvertTo = new frmConvertTo(application);
             frm_ConvertTo.Show();
         }
         else
         {
             frm_ConvertTo.Activate();
         }
     }
     else if (cID == CommandID_PSTOCOREL)
     {
         if (frm_PStoCurve == null || !frm_PStoCurve.Created)
         {
             frm_PStoCurve = new frmPStoCurve(application);
             frm_PStoCurve.Show();
         }
         else
         {
             frm_PStoCurve.Activate();
         }
     }
     else if (cID == CommandID_CROPMARK)
     {
         if (frm_CropMark == null || !frm_CropMark.Created)
         {
             frm_CropMark = new frmCropMark(application);
             frm_CropMark.Show();
         }
         else
         {
             frm_CropMark.Activate();
         }
     }
 }