Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/15 16:14:30 (9 years ago)
Author:
gkronber
Message:

#2522:

  • moved UI components out of HeuristicLab.PluginInfrastructure -> HeuristicLab.PluginInfrastructure.UI
  • moved ErrorDialog to HeuristicLab.MainForm.WindowsForms
  • moved ErrorHandling (for building an error message string) to HeuristicLab.Common
  • Changed exception handlers in Views to use MainForm.ShowError()
  • Changed usages for ErrorDialog in non-UI components to throw exceptions instead.
Location:
branches/RefactorPluginInfrastructure-2522/HeuristicLab.Clients.Access.Administration/3.3/Views
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.Clients.Access.Administration/3.3/Views/RefreshableRoleListView.cs

    r12012 r13338  
    2121
    2222using System;
     23using HeuristicLab.MainForm;
     24
    2325namespace HeuristicLab.Clients.Access.Administration {
    2426  public partial class RefreshableRoleListView : RefreshableView {
     
    2830
    2931    protected override void RefreshData() {
    30       Content.RefreshRolesAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     32      Content.RefreshRolesAsync((ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    3133    }
    3234
     
    6769    void Roles_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<Role>> e) {
    6870      foreach (var u in e.Items) {
    69         Content.DeleteRoleAsync(u.Value, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     71        Content.DeleteRoleAsync(u.Value, (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    7072      }
    7173    }
    7274
    7375    private void storeButton_Click(object sender, EventArgs e) {
    74       Content.StoreRolesAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     76      Content.StoreRolesAsync((ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    7577    }
    7678  }
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.Clients.Access.Administration/3.3/Views/RefreshableRoleSelectionListView.cs

    r12012 r13338  
    2424using System.Windows.Forms;
    2525using HeuristicLab.Core;
     26using HeuristicLab.MainForm;
    2627
    2728namespace HeuristicLab.Clients.Access.Administration {
     
    5051          }
    5152          CurrentRoles = AccessAdministrationClient.CallAccessService<List<Role>>(s => s.GetUserRoles(CurrentUser));
    52         }), PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     53        }), (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    5354      }
    5455    }
     
    109110          AccessAdministrationClient.CallAccessService(s => s.RemoveUserFromRole(role, CurrentUser));
    110111        }
    111       }), PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     112      }), (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    112113    }
    113114  }
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.Clients.Access.Administration/3.3/Views/RefreshableUserGroupListView.cs

    r12012 r13338  
    2121
    2222using System;
     23using HeuristicLab.MainForm;
     24
    2325namespace HeuristicLab.Clients.Access.Administration {
    2426  public partial class RefreshableUserGroupListView : RefreshableView {
     
    2830
    2931    protected override void RefreshData() {
    30       Content.RefreshUserGroupsAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     32      Content.RefreshUserGroupsAsync((ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    3133    }
    3234
     
    6062    void Groups_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<UserGroup>> e) {
    6163      foreach (var u in e.Items) {
    62         Content.DeleteUserGroupAsync(u.Value, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     64        Content.DeleteUserGroupAsync(u.Value, (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    6365      }
    6466    }
     
    7274
    7375    private void storeButton_Click(object sender, EventArgs e) {
    74       Content.StoreUserGroupsAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     76      Content.StoreUserGroupsAsync((ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    7577    }
    7678  }
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.Clients.Access.Administration/3.3/Views/RefreshableUserListView.cs

    r12012 r13338  
    2121
    2222using System;
     23using HeuristicLab.MainForm;
     24
    2325namespace HeuristicLab.Clients.Access.Administration {
    2426  public partial class RefreshableUserListView : RefreshableView {
     
    2830
    2931    protected override void RefreshData() {
    30       Content.RefreshUsersAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     32      Content.RefreshUsersAsync((ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    3133    }
    3234
     
    6870      foreach (var u in e.Items) {
    6971        if (u.Value.Id != Guid.Empty) {
    70           Content.DeleteUserAsync(u.Value, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     72          Content.DeleteUserAsync(u.Value, (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    7173        }
    7274      }
     
    7476
    7577    private void storeButton_Click(object sender, EventArgs e) {
    76       Content.StoreUsersAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     78      Content.StoreUsersAsync((ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    7779    }
    7880  }
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.Clients.Access.Administration/3.3/Views/UserGroupView.cs

    r12012 r13338  
    8686      });
    8787
    88       AccessAdministrationClient.Instance.ExecuteActionAsync(storeAction, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
    89       AccessAdministrationClient.Instance.ExecuteActionAsync(deleteAction, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     88      AccessAdministrationClient.Instance.ExecuteActionAsync(storeAction, (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
     89      AccessAdministrationClient.Instance.ExecuteActionAsync(deleteAction, (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    9090    }
    9191
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.Clients.Access.Administration/3.3/Views/UserView.cs

    r12012 r13338  
    9292      });
    9393
    94       AccessAdministrationClient.Instance.ExecuteActionAsync(a, PluginInfrastructure.ErrorHandling.ShowErrorDialog); ;
     94      AccessAdministrationClient.Instance.ExecuteActionAsync(a, (ex) => MainFormManager.MainForm.ShowError(ex.Message, ex));
    9595    }
    9696
Note: See TracChangeset for help on using the changeset viewer.