示例#1
0
        private void MogProcess()
        {
            while (!MOG_Main.isShutdown())
            {
                try
                {
                    MOG_Main.Process();
                }
                catch (Exception ex)
                {
                    MOG_Command pNotify = new MOG_Command();
                    pNotify.Setup_NotifySystemException("MogProcess:Exception Error durring Mog.Process" + "\n\nMessage: " + ex.ToString() + "\n\nStackTrace:" + ex.StackTrace.ToString());
                    MOG_ControllerSystem.GetCommandManager().CommandProcess(pNotify);

                    MOG_REPORT.LogError("MogProcess", "Exception Error durring Mog.Process");
                    MOG_REPORT.LogError("MogProcess", ex.ToString());
                    MOG_REPORT.LogError("MogProcess", ex.StackTrace.ToString());
                }

                Thread.Sleep(100);
            }

            Application.Exit();
            mMogProcess.Abort();
            mMogProcess = null;
        }
示例#2
0
        private void MogProcess()
        {
            // Loop until we shutdown
            while (!MOG_Main.IsShutdown())
            {
                // Only process while we are not shutting down?
                if (!MOG_Main.IsShutdownInProgress())
                {
                    try
                    {
                        MOG_Main.Process();
                    }
                    catch (Exception ex)
                    {
                        MOG_Report.ReportSilent("MogProcess", ex.Message, ex.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
                    }
                }

                Thread.Sleep(1);
            }

            // Inform our parent thread that we have exited
            mMogProcess = null;

            // Gracefully wait a while to see if our parent thread will terminate the application for us?
            Thread.Sleep(500);
            // At this point, let's take the inititive and shut ourselves down
            Application.Exit();
        }