Exemple #1
0
 private void ButtonClicked(object sender, EventArgs args)
 {
     try
     {
         if (Action != null)
         {
             Action.Execute(this, new EventParams());
         }
     }
     catch (Exception AException)
     {
         Session.HandleException(AException);                    //don't re-throw
     }
 }
Exemple #2
0
 protected override void BeforeDeactivate()
 {
     try
     {
         if (OnBeforeDeactivate != null)
         {
             OnBeforeDeactivate.Execute(this, new EventParams());
         }
     }
     catch (Exception exception)
     {
         Session.HandleException(exception);
     }
     base.BeforeDeactivate();
 }
Exemple #3
0
 protected override void AfterActivate()
 {
     base.AfterActivate();
     try
     {
         if (OnAfterActivate != null)
         {
             OnAfterActivate.Execute(this, new EventParams());
         }
     }
     catch (Exception exception)
     {
         Session.HandleException(exception);
     }
 }
Exemple #4
0
 protected override void Activate()
 {
     try
     {
         if (OnActivate != null)
         {
             OnActivate.Execute(this, new EventParams());
         }
     }
     catch (Exception exception)
     {
         Session.HandleException(exception);
     }
     InternalUpdateText();
     base.Activate();
 }
Exemple #5
0
        protected override bool ProcessCmdKey(ref Message message, Keys keyData)
        {
            bool result;

            try
            {
                result = base.ProcessCmdKey(ref message, keyData);
            }
            catch (Exception exception)
            {
                // HACK: This works around the issue where keys are not treated as handled when an exception is thrown
                Session.HandleException(exception);
                return(true);
            }
            return(result);
        }
Exemple #6
0
 public void FormClosed()
 {
     try
     {
         try
         {
             HostNode.Session.Forms.Remove(this);
         }
         finally
         {
             try
             {
                 if (_form.DialogResult == WinForms.DialogResult.OK)
                 {
                     FormAccepted();
                 }
                 else
                 {
                     FormRejected();
                 }
             }
             finally
             {
                 try
                 {
                     if (OnClosed != null)
                     {
                         OnClosed(this, null);
                     }
                 }
                 finally
                 {
                     try
                     {
                         if (_onCloseForm != null)
                         {
                             _onCloseForm(this);
                             _onCloseForm = null;
                         }
                     }
                     finally
                     {
                         if ((_form == null) || !_form.Modal)                                  // Some forms (such as the main form) may be truly modal.
                         {
                             EndChildModal();
                             if ((HostNode != null) && (HostNode.NextRequest == null))
                             {
                                 HostNode.Dispose();
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception AException)
     {
         Session.HandleException(AException);
         if (_form != null)
         {
             _form.DialogResult = WinForms.DialogResult.Cancel;
         }
     }
 }