public void AddUserToHistory() { var index = UsersHistory.IndexOf(UserName); if (index >= 0) { UsersHistory.RemoveAt(index); } UsersHistory.Insert(0, UserName); }
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); }