Пример #1
0
 public UserViewModel(User user)
 {
     if (user == null) {
         user = new User("<User Name>");
     }
     _user = user;
 }
Пример #2
0
 public UserViewModelNew(User user)
 {
     _user = user;
     // Create new and assign default value
     if (user == null)
     {
         _user = new User("<User Name>");
     }
 }
Пример #3
0
 public static void DeleteUser(User user)
 {
     //Check existence
     if (!UsersDict.ContainsKey(user.UserName))
     {
         // Log and show
         return;
     }
     //Perform delete
     UsersDict.Remove(user.UserName);
 }
Пример #4
0
 public static void UpdateUser(User user)
 {
     //Check existence
     if (!UsersDict.ContainsKey(user.UserName))
     {
         // Add it then
         UsersDict.Add(user.UserName, user);
     }
     else
     {
         //Update
         UsersDict[user.UserName] = user;
     }
 }