public Person NewPerson() { _indPeople.OnSet(); Person person = new Person(); _people.Add(person); return person; }
public static PersonViewModel Wrap(Person person, ContactList contactList) { if (person == null) return null; else return new PersonViewModel(person, contactList); }
public static void Marry(Person a, Person b) { // If either person is already married, // annul that marriage. if (a != null && a.Spouse != null) { a.Spouse.Spouse = null; a.Spouse = null; } if (b != null && b.Spouse != null) { b.Spouse.Spouse = null; b.Spouse = null; } // Marry the two people if (a != null && b != null) { a.Spouse = b; b.Spouse = a; } }
public void EndEdit() { if (_copy != _person) { _person.First = _copy.First; _person.Last = _copy.Last; _person.Prefix = _copy.Prefix; _person.Gender = _copy.Gender; _copy = _person; } }
public void CancelEdit() { _copy = _person; }
public void BeginEdit() { _copy = new Person() { First = _person.First, Last = _person.Last, Prefix = _person.Prefix, Gender = _person.Gender }; }
public DataGridPersonViewModel(Person person, ContactList contactList) { _person = person; _copy = _person; _contactList = contactList; }
public PersonViewModelBase(Person person) { _person = person; }
public PersonViewModel(Person person, ContactList contactList) : base(person) { _contactList = contactList; }
public static SpouseViewModel Wrap(Person spouse) { return new SpouseViewModel(spouse); }
private SpouseViewModel(Person spouse) { _spouse = spouse; }
public void DeletePerson(Person person) { _indPeople.OnSet(); _people.Remove(person); }