public AssignedUserModel(Server server, IEnumerable<User> users, User user, DateTime userAssignedDate) { if (server == null) throw new ArgumentNullException("server"); if (users == null) throw new ArgumentNullException("users"); Users = users; UpdateFromUser(user, userAssignedDate); }
public ServerModel(Server server, IEnumerable<User> users) { ServerId = server.ServerId; Yahoo = new StatusModel(); Hotmail = new StatusModel(); Aol = new StatusModel(); AssignedUser = new AssignedUserModel(this, users); AssignedUser.PropertyChanged += (sender, args) => OnPropertyChanged("RowBackColor"); UpdateFromServer(server); }
public void UpdateFromServer(Server server) { Name = server.Name; Address = server.Address; IsForTesting = server.IsForTesting; AssignedUser.UpdateFromUser(server.AssignedUser, server.UserAssignedDateTime); Yahoo.UpdateFromProviderStatus(server.Providers.FirstOrDefault(p => p.Provider == Provider.Yahoo)); Hotmail.UpdateFromProviderStatus(server.Providers.FirstOrDefault(p => p.Provider == Provider.Hotmail)); Aol.UpdateFromProviderStatus(server.Providers.FirstOrDefault(p => p.Provider == Provider.Aol)); }