Changeset 7635
- Timestamp:
- 03/19/12 16:16:18 (13 years ago)
- Location:
- branches/ClientUserManagement
- Files:
-
- 8 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/AccessAdministrationClient.cs
r7614 r7635 43 43 } 44 44 } 45 46 public ItemList<UserGroup> Groups { get; set; } 45 47 #endregion 46 48 … … 48 50 49 51 #region Refresh 50 public void Refresh () {52 public void RefreshUsers() { 51 53 users = new ItemList<User>(); 52 54 users.AddRange(CallAccessService<ItemList<User>>(s => new ItemList<User>(s.GetAllUsers()))); 53 55 } 54 56 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); 73 59 } 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 74 70 public void ExecuteActionAsync(Action action, Action<Exception> exceptionCallback) { 75 71 var call = new Func<Exception>(delegate() { -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/HeuristicLab.Clients.Access.Administration-3.3.csproj
r7614 r7635 129 129 <Compile Include="Plugin.cs" /> 130 130 <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> 131 155 <Compile Include="Views\RefreshableUserListView.cs"> 132 156 <SubType>UserControl</SubType> -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/RefreshableUserListView.cs
r7614 r7635 20 20 #endregion 21 21 22 using System; 22 23 namespace HeuristicLab.Clients.Access.Administration { 23 24 public partial class RefreshableUserListView : RefreshableView { … … 27 28 28 29 protected override void RefreshData() { 29 Content.Refresh(); 30 userListView.Content = Content.Users; 30 Content.RefreshUsersAsync(PluginInfrastructure.ErrorHandling.ShowErrorDialog); 31 31 } 32 32 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 } 33 41 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 } 34 51 } 35 52 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserAdministrationDialog.Designer.cs
r7614 r7635 25 25 private void InitializeComponent() { 26 26 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(); 27 34 this.SuspendLayout(); 28 35 // 29 36 // refreshableUserListView 30 37 // 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 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))); 34 41 this.refreshableUserListView.Caption = "View"; 35 42 this.refreshableUserListView.Content = null; 36 this.refreshableUserListView.Location = new System.Drawing.Point( 12, 12);43 this.refreshableUserListView.Location = new System.Drawing.Point(6, 6); 37 44 this.refreshableUserListView.Name = "refreshableUserListView"; 38 45 this.refreshableUserListView.ReadOnly = false; 39 this.refreshableUserListView.Size = new System.Drawing.Size(7 82, 402);46 this.refreshableUserListView.Size = new System.Drawing.Size(762, 364); 40 47 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; 41 96 // 42 97 // UserAdministrationDialog … … 45 100 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 46 101 this.ClientSize = new System.Drawing.Size(806, 426); 47 this.Controls.Add(this. refreshableUserListView);102 this.Controls.Add(this.mainTabControl); 48 103 this.MaximizeBox = false; 49 104 this.MinimizeBox = false; … … 54 109 this.Text = "User Administration"; 55 110 this.Load += new System.EventHandler(this.UserAdministrationDialog_Load); 111 this.mainTabControl.ResumeLayout(false); 112 this.usersTabPage.ResumeLayout(false); 113 this.UserGroupsTabPage.ResumeLayout(false); 56 114 this.ResumeLayout(false); 57 115 … … 61 119 62 120 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; 63 125 } 64 126 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserAdministrationDialog.cs
r7614 r7635 31 31 if (!DesignMode) { 32 32 refreshableUserListView.Content = AccessAdministrationClient.Instance; 33 refreshableUserGroupListView.Content = AccessAdministrationClient.Instance; 33 34 } 34 35 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.cs
r7611 r7635 34 34 } 35 35 36 private void DisplayError(Exception ex) {37 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);38 }39 40 36 protected override void RefreshData() { 41 Content.ExecuteActionAsync(RefreshUserData, DisplayError);37 Content.ExecuteActionAsync(RefreshUserData, PluginInfrastructure.ErrorHandling.ShowErrorDialog); 42 38 } 43 39
Note: See TracChangeset
for help on using the changeset viewer.