Esempio n. 1
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     //Logger.Debug("OnFormClosing: reason={0}, isRequest={1}, isUi={2}", e.CloseReason, _isCloseRequest, _isUiRequest);
     if (!_isCloseRequest &&
         CommandClose != null)
     {
         _isCloseCalled = false;
         _isUiRequest   = true;
         var canClose = CommandClose.CanExecute(null);
         if (canClose)
         {
             CommandClose.Execute(null);
             canClose = _isCloseCalled;
         }
         _isUiRequest = false;
         if (!canClose)
         {
             // WARN: Mono runtime has a bug, so if the user will
             // close parent window, it will be closed although Cancel=true.
             // In such case, attempt to show the window will cause
             // fatal Mono runtime bug (it requires OS reboot).
             // So, we call it async to avoid such issues.
             e.Cancel = true;
             // show & highlight blocking window
             BeginInvoke(new Action(() =>
             {
                 Show();
                 WindowState = FormWindowState.Normal;
                 Activate();
             }), null);
         }
     }
     base.OnFormClosing(e);
 }
Esempio n. 2
0
        protected override void OnTargetStateChanged()
        {
            base.OnTargetStateChanged();
            CommandClose.Update();
            CommandContinue.Update();
            CommandBreak.Update();
            CommandStepInto.Update();
            CommandStepOver.Update();
            CommandStepOut.Update();

            StatusTact = IsRunning ? string.Format("T: - / {0}", Target.FrameTactCount) :
                         string.Format("T: {0} / {1}", Target.GetFrameTact(), Target.FrameTactCount);
            StatusText = IsRunning ? "Running" : "Ready";
        }