Changeset 5550 for branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Authentication/AuthenticationClient.cs
- Timestamp:
- 02/23/11 04:13:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Authentication/AuthenticationClient.cs
r5533 r5550 51 51 public void Refresh() { 52 52 OnRefreshing(); 53 53 try { 54 users = CallAuthenticationService<List<User>>(s => s.GetUsers()).OrderBy(x => x.Name); 55 } 56 finally { 57 OnRefreshed(); 58 } 59 } 60 public void RefreshAsync(Action<Exception> exceptionCallback) { 54 61 var call = new Func<Exception>(delegate() { 55 62 try { 56 users = CallAuthenticationService<List<User>>(s => s.GetUsers()).OrderBy(x => x.Name); 57 return null; 63 Refresh(); 58 64 } 59 65 catch (Exception ex) { 60 66 return ex; 61 67 } 68 return null; 62 69 }); 63 70 call.BeginInvoke(delegate(IAsyncResult result) { 64 71 Exception ex = call.EndInvoke(result); 65 if (ex != null) ErrorHandling.ShowErrorDialog("Refresh failed.", ex); 66 OnRefreshed(); 72 if (ex != null) exceptionCallback(ex); 67 73 }, null); 74 } 75 #endregion 76 77 #region User Methods 78 public static IEnumerable<User> GetUsers() { 79 return CallAuthenticationService<List<User>>(s => s.GetUsers()).OrderBy(x => x.Name); 68 80 } 69 81 #endregion … … 83 95 84 96 #region Helpers 85 private T CallAuthenticationService<T>(Func<IAuthenticationService, T> call) {97 private static T CallAuthenticationService<T>(Func<IAuthenticationService, T> call) { 86 98 AuthenticationServiceClient client = ClientFactory.CreateClient<AuthenticationServiceClient, IAuthenticationService>(); 87 99 try {
Note: See TracChangeset
for help on using the changeset viewer.