コード例 #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);
     }
   }
 }
コード例 #2
0
ファイル: ResourcesView.cs プロジェクト: t-h-e/HeuristicLab
 private void ShowHiveInformationDialog() {
   if (this.InvokeRequired) {
     Invoke(new Action(ShowHiveInformationDialog));
   } else {
     using (HiveInformationDialog dialog = new HiveInformationDialog()) {
       dialog.ShowDialog(this);
     }
   }
 }