IList <WcfUser> IWcfService.GetUsers(string id, int startIndex, int count, out int overallCount) { WcfUser[] result = null; var users = GetUsers(id); var items = users.GetUsers(accounts.DefaultAccountId, startIndex, count); var account = accounts.GetDefaultAccount(); if (items != null && account != null) { result = new WcfUser[items.Count]; for (int i = 0; i < result.Length; i++) { result[i] = new WcfUser(items[i]) { Availability = enhancedPresence.GetAvailability(@"sip:" + items[i].Name + @"@" + account.DomainName), } } ; } overallCount = users.GetCount(accounts.DefaultAccountId); return(result); }
void IWcfService.UpdateUser(string usersId, WcfUser user) { var users = GetUsers(usersId); if (users.IsReadOnly == false) { var oldUser = users.GetByName(accounts.DefaultAccountId, user.Name); users.Update(accounts.DefaultAccountId, user.ToIUser((oldUser == null) ? string.Empty : oldUser.Password)); } }
private void OnUserAddedOrUpdated(string usersId, WcfUser wcfUser) { if (callback != null) { try { callback.UserAddedOrUpdated(usersId, wcfUser); } catch { callback = null; } } }
void IWcfService.AddUser(string usersId, WcfUser user, string password) { try { var users = GetUsers(usersId); if (users.IsReadOnly == false) { users.Add(accounts.DefaultAccountId, user.ToIUser(password)); } } catch (UsersException) { } }
IList<WcfUser> IWcfService.GetUsers(string id, int startIndex, int count, out int overallCount) { WcfUser[] result = null; var users = GetUsers(id); var items = users.GetUsers(accounts.DefaultAccountId, startIndex, count); var account = accounts.GetDefaultAccount(); if (items != null && account != null) { result = new WcfUser[items.Count]; for (int i = 0; i < result.Length; i++) result[i] = new WcfUser(items[i]) { Availability = enhancedPresence.GetAvailability(@"sip:" + items[i].Name + @"@" + account.DomainName), }; } overallCount = users.GetCount(accounts.DefaultAccountId); return result; }
void IWcfService.AddUser(string usersId, WcfUser user, string password) { try { var users = GetUsers(usersId); if (users.IsReadOnly == false) users.Add(accounts.DefaultAccountId, user.ToIUser(password)); } catch (UsersException) { } }