Exemplo n.º 1
0
        public void AddUserToHistory()
        {
            var index = UsersHistory.IndexOf(UserName);

            if (index >= 0)
            {
                UsersHistory.RemoveAt(index);
            }
            UsersHistory.Insert(0, UserName);
        }
Exemplo n.º 2
0
        public void AddUserToHistory(string userName)
        {
            if (string.IsNullOrEmpty(userName))
            {
                return;
            }

            var index = UsersHistory.IndexOf(userName);

            if (index >= 0)
            {
                UsersHistory.RemoveAt(index);
            }
            UsersHistory.Insert(0, userName);
        }