Changeset 7635 for branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/AccessAdministrationClient.cs
- Timestamp:
- 03/19/12 16:16:18 (12 years ago)
- File:
-
- 1 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() {
Note: See TracChangeset
for help on using the changeset viewer.