Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7635


Ignore:
Timestamp:
03/19/12 16:16:18 (13 years ago)
Author:
ascheibe
Message:

#1648 added admin views for displaying user groups

Location:
branches/ClientUserManagement
Files:
8 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/AccessAdministrationClient.cs

    r7614 r7635  
    4343      }
    4444    }
     45
     46    public ItemList<UserGroup> Groups { get; set; }
    4547    #endregion
    4648
     
    4850
    4951    #region Refresh
    50     public void Refresh() {
     52    public void RefreshUsers() {
    5153      users = new ItemList<User>();
    5254      users.AddRange(CallAccessService<ItemList<User>>(s => new ItemList<User>(s.GetAllUsers())));
    5355    }
    5456
    55     public void RefreshAsync(Action<Exception> exceptionCallback) {
    56       var call = new Func<Exception>(delegate() {
    57         try {
    58           OnRefreshing();
    59           Refresh();
    60         }
    61         catch (Exception ex) {
    62           return ex;
    63         }
    64         finally {
    65           OnRefreshed();
    66         }
    67         return null;
    68       });
    69       call.BeginInvoke(delegate(IAsyncResult result) {
    70         Exception ex = call.EndInvoke(result);
    71         if (ex != null) exceptionCallback(ex);
    72       }, null);
     57    public void RefreshUsersAsync(Action<Exception> exceptionCallback) {
     58      ExecuteActionAsync(RefreshUsers, exceptionCallback);
    7359    }
     60
     61    public void RefreshUserGroups() {
     62      Groups = new ItemList<UserGroup>();
     63      Groups.AddRange(CallAccessService<ItemList<UserGroup>>(s => new ItemList<UserGroup>(s.GetAllUserGroups())));
     64    }
     65
     66    public void RefreshUserGroupsAsync(Action<Exception> exceptionCallback) {
     67      ExecuteActionAsync(RefreshUserGroups, exceptionCallback);
     68    }
     69
    7470    public void ExecuteActionAsync(Action action, Action<Exception> exceptionCallback) {
    7571      var call = new Func<Exception>(delegate() {
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/HeuristicLab.Clients.Access.Administration-3.3.csproj

    r7614 r7635  
    129129    <Compile Include="Plugin.cs" />
    130130    <Compile Include="Properties\AssemblyInfo.cs" />
     131    <Compile Include="Views\UserGroupListView.cs">
     132      <SubType>UserControl</SubType>
     133    </Compile>
     134    <Compile Include="Views\UserGroupListView.Designer.cs">
     135      <DependentUpon>UserGroupListView.cs</DependentUpon>
     136    </Compile>
     137    <Compile Include="Views\RefreshableUserGroupListView.cs">
     138      <SubType>UserControl</SubType>
     139    </Compile>
     140    <Compile Include="Views\RefreshableUserGroupListView.Designer.cs">
     141      <DependentUpon>RefreshableUserGroupListView.cs</DependentUpon>
     142    </Compile>
     143    <Compile Include="Views\UserGroupView.cs">
     144      <SubType>UserControl</SubType>
     145    </Compile>
     146    <Compile Include="Views\UserGroupView.Designer.cs">
     147      <DependentUpon>UserGroupView.cs</DependentUpon>
     148    </Compile>
     149    <Compile Include="Views\RoleView.cs">
     150      <SubType>UserControl</SubType>
     151    </Compile>
     152    <Compile Include="Views\RoleView.Designer.cs">
     153      <DependentUpon>RoleView.cs</DependentUpon>
     154    </Compile>
    131155    <Compile Include="Views\RefreshableUserListView.cs">
    132156      <SubType>UserControl</SubType>
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/RefreshableUserListView.cs

    r7614 r7635  
    2020#endregion
    2121
     22using System;
    2223namespace HeuristicLab.Clients.Access.Administration {
    2324  public partial class RefreshableUserListView : RefreshableView {
     
    2728
    2829    protected override void RefreshData() {
    29       Content.Refresh();
    30       userListView.Content = Content.Users;
     30      Content.RefreshUsersAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog);
    3131    }
    3232
     33    protected override void Content_Refreshing(object sender, EventArgs e) {
     34      if (InvokeRequired) {
     35        Invoke(new EventHandler(Content_Refreshing), sender, e);
     36      } else {
     37        base.Content_Refreshing(sender, e);
     38        userListView.Enabled = false;
     39      }
     40    }
    3341
     42    protected override void Content_Refreshed(object sender, EventArgs e) {
     43      if (InvokeRequired) {
     44        Invoke(new EventHandler(Content_Refreshed), sender, e);
     45      } else {
     46        base.Content_Refreshed(sender, e);
     47        userListView.Enabled = true;
     48        userListView.Content = Content.Users;
     49      }
     50    }
    3451  }
    3552}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserAdministrationDialog.Designer.cs

    r7614 r7635  
    2525    private void InitializeComponent() {
    2626      this.refreshableUserListView = new HeuristicLab.Clients.Access.Administration.RefreshableUserListView();
     27      this.mainTabControl = new System.Windows.Forms.TabControl();
     28      this.usersTabPage = new System.Windows.Forms.TabPage();
     29      this.UserGroupsTabPage = new System.Windows.Forms.TabPage();
     30      this.refreshableUserGroupListView = new HeuristicLab.Clients.Access.Administration.RefreshableUserGroupListView();
     31      this.mainTabControl.SuspendLayout();
     32      this.usersTabPage.SuspendLayout();
     33      this.UserGroupsTabPage.SuspendLayout();
    2734      this.SuspendLayout();
    2835      //
    2936      // refreshableUserListView
    3037      //
    31       this.refreshableUserListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    32                   | System.Windows.Forms.AnchorStyles.Left)
    33                   | System.Windows.Forms.AnchorStyles.Right)));
     38      this.refreshableUserListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     39            | System.Windows.Forms.AnchorStyles.Left)
     40            | System.Windows.Forms.AnchorStyles.Right)));
    3441      this.refreshableUserListView.Caption = "View";
    3542      this.refreshableUserListView.Content = null;
    36       this.refreshableUserListView.Location = new System.Drawing.Point(12, 12);
     43      this.refreshableUserListView.Location = new System.Drawing.Point(6, 6);
    3744      this.refreshableUserListView.Name = "refreshableUserListView";
    3845      this.refreshableUserListView.ReadOnly = false;
    39       this.refreshableUserListView.Size = new System.Drawing.Size(782, 402);
     46      this.refreshableUserListView.Size = new System.Drawing.Size(762, 364);
    4047      this.refreshableUserListView.TabIndex = 0;
     48      //
     49      // mainTabControl
     50      //
     51      this.mainTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     52            | System.Windows.Forms.AnchorStyles.Left)
     53            | System.Windows.Forms.AnchorStyles.Right)));
     54      this.mainTabControl.Controls.Add(this.usersTabPage);
     55      this.mainTabControl.Controls.Add(this.UserGroupsTabPage);
     56      this.mainTabControl.Location = new System.Drawing.Point(12, 12);
     57      this.mainTabControl.Name = "mainTabControl";
     58      this.mainTabControl.SelectedIndex = 0;
     59      this.mainTabControl.Size = new System.Drawing.Size(782, 402);
     60      this.mainTabControl.TabIndex = 1;
     61      //
     62      // usersTabPage
     63      //
     64      this.usersTabPage.Controls.Add(this.refreshableUserListView);
     65      this.usersTabPage.Location = new System.Drawing.Point(4, 22);
     66      this.usersTabPage.Name = "usersTabPage";
     67      this.usersTabPage.Padding = new System.Windows.Forms.Padding(3);
     68      this.usersTabPage.Size = new System.Drawing.Size(774, 376);
     69      this.usersTabPage.TabIndex = 0;
     70      this.usersTabPage.Text = "Users";
     71      this.usersTabPage.UseVisualStyleBackColor = true;
     72      //
     73      // UserGroupsTabPage
     74      //
     75      this.UserGroupsTabPage.Controls.Add(this.refreshableUserGroupListView);
     76      this.UserGroupsTabPage.Location = new System.Drawing.Point(4, 22);
     77      this.UserGroupsTabPage.Name = "UserGroupsTabPage";
     78      this.UserGroupsTabPage.Padding = new System.Windows.Forms.Padding(3);
     79      this.UserGroupsTabPage.Size = new System.Drawing.Size(774, 376);
     80      this.UserGroupsTabPage.TabIndex = 1;
     81      this.UserGroupsTabPage.Text = "Groups";
     82      this.UserGroupsTabPage.UseVisualStyleBackColor = true;
     83      //
     84      // refreshableUserGroupListView
     85      //
     86      this.refreshableUserGroupListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     87            | System.Windows.Forms.AnchorStyles.Left)
     88            | System.Windows.Forms.AnchorStyles.Right)));
     89      this.refreshableUserGroupListView.Caption = "View";
     90      this.refreshableUserGroupListView.Content = null;
     91      this.refreshableUserGroupListView.Location = new System.Drawing.Point(6, 6);
     92      this.refreshableUserGroupListView.Name = "refreshableUserGroupListView";
     93      this.refreshableUserGroupListView.ReadOnly = false;
     94      this.refreshableUserGroupListView.Size = new System.Drawing.Size(762, 364);
     95      this.refreshableUserGroupListView.TabIndex = 0;
    4196      //
    4297      // UserAdministrationDialog
     
    45100      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    46101      this.ClientSize = new System.Drawing.Size(806, 426);
    47       this.Controls.Add(this.refreshableUserListView);
     102      this.Controls.Add(this.mainTabControl);
    48103      this.MaximizeBox = false;
    49104      this.MinimizeBox = false;
     
    54109      this.Text = "User Administration";
    55110      this.Load += new System.EventHandler(this.UserAdministrationDialog_Load);
     111      this.mainTabControl.ResumeLayout(false);
     112      this.usersTabPage.ResumeLayout(false);
     113      this.UserGroupsTabPage.ResumeLayout(false);
    56114      this.ResumeLayout(false);
    57115
     
    61119
    62120    private RefreshableUserListView refreshableUserListView;
     121    private System.Windows.Forms.TabControl mainTabControl;
     122    private System.Windows.Forms.TabPage usersTabPage;
     123    private System.Windows.Forms.TabPage UserGroupsTabPage;
     124    private RefreshableUserGroupListView refreshableUserGroupListView;
    63125  }
    64126}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserAdministrationDialog.cs

    r7614 r7635  
    3131      if (!DesignMode) {
    3232        refreshableUserListView.Content = AccessAdministrationClient.Instance;
     33        refreshableUserGroupListView.Content = AccessAdministrationClient.Instance;
    3334      }
    3435    }
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.cs

    r7611 r7635  
    3434    }
    3535
    36     private void DisplayError(Exception ex) {
    37       PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);
    38     }
    39 
    4036    protected override void RefreshData() {
    41       Content.ExecuteActionAsync(RefreshUserData, DisplayError);
     37      Content.ExecuteActionAsync(RefreshUserData, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
    4238    }
    4339
Note: See TracChangeset for help on using the changeset viewer.