Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/04/11 16:14:02 (13 years ago)
Author:
ascheibe
Message:

#1233 show messageboxes instead of exceptions if the username or password is wrong

Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj

    r6792 r6864  
    145145    <Reference Include="System.Drawing" />
    146146    <Reference Include="System.Runtime.Serialization" />
     147    <Reference Include="System.ServiceModel" />
    147148    <Reference Include="System.Windows.Forms" />
    148149    <Reference Include="System.Windows.Forms.DataVisualization" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.cs

    r6792 r6864  
    2222using System;
    2323using System.Linq;
     24using System.ServiceModel.Security;
    2425using System.Windows.Forms;
    2526using HeuristicLab.Collections;
     
    7071        hiveExperimentListView.Content = Content.Jobs;
    7172        if (Content != null)
    72           Content.RefreshAsync(new Action<Exception>((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Refresh failed.", ex)));
     73          Content.RefreshAsync(new Action<Exception>((Exception ex) => HandleServiceException(ex)));
    7374      }
    7475    }
     
    101102
    102103    private void refreshButton_Click(object sender, EventArgs e) {
    103       Content.RefreshAsync(new Action<Exception>((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Refresh failed.", ex)));
     104      Content.RefreshAsync(new Action<Exception>((Exception ex) => HandleServiceException(ex)));
     105    }
     106
     107    private void HandleServiceException(Exception ex) {
     108      if (ex is MessageSecurityException) {
     109        MessageBox.Show("A Message Security error has occured. This normally means that your user name or password is wrong.", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     110      } else {
     111        ErrorHandling.ShowErrorDialog(this, "Refresh failed.", ex);
     112      }
    104113    }
    105114
Note: See TracChangeset for help on using the changeset viewer.