Esempio n. 1
0
        private static UserStr[] GetUsers(IReadOnlyDictionary <string, byte> states)
        {
            var users      = CoreContext.UserManager.GetUsers().Where(user => !user.IsMe()).SortByUserName();
            var usersArray = new UserStr[users.Count];

            for (var i = 0; i < users.Count; i++)
            {
                byte state;
                var  userName = users[i].UserName.ToLowerInvariant();
                if (!states.TryGetValue(userName, out state))
                {
                    state = UserOffline;
                }
                usersArray[i] = new UserStr {
                    UserName = userName, DisplayUserName = users[i].DisplayUserName(), State = state
                };
            }
            return(usersArray);
        }
Esempio n. 2
0
 private static UserStr[] GetUsers(IReadOnlyDictionary<string, byte> states)
 {
     var users = CoreContext.UserManager.GetUsers().Where(user => !user.IsMe()).SortByUserName();
     var usersArray = new UserStr[users.Count];
     for (var i = 0; i < users.Count; i++)
     {
         byte state;
         var userName = users[i].UserName.ToLowerInvariant();
         if (!states.TryGetValue(userName, out state))
         {
             state = UserOffline;
         }
         usersArray[i] = new UserStr { UserName = userName, DisplayUserName = users[i].DisplayUserName(), State = state };
     }
     return usersArray;
 }