Esempio n. 1
0
 private void HandleServiceException(Exception ex)
 {
     if (this.InvokeRequired)
     {
         Invoke(new Action <Exception>(HandleServiceException), ex);
     }
     else
     {
         if (ex is MessageSecurityException)
         {
             string message =
                 "A Message Security error has occured. This normally means that your user name or password is wrong. Detailed information: " + Environment.NewLine;
             message += HiveServiceLocator.Instance.GetEndpointInformation();
             ErrorHandling.ShowErrorDialog(this, message, ex);
         }
         else if (ex is AnonymousUserException)
         {
             using (HiveInformationDialog dialog = new HiveInformationDialog()) {
                 dialog.ShowDialog(this);
             }
         }
         else
         {
             ErrorHandling.ShowErrorDialog(this,
                                           "Refresh failed. Detailed information: " + Environment.NewLine + HiveServiceLocator.Instance.GetEndpointInformation(), ex);
         }
     }
 }
Esempio n. 2
0
 private void ShowHiveInformationDialog()
 {
     if (InvokeRequired)
     {
         Invoke((Action)ShowHiveInformationDialog);
     }
     else
     {
         using (HiveInformationDialog dialog = new HiveInformationDialog()) {
             dialog.ShowDialog(this);
         }
     }
 }