コード例 #1
0
 public Person NewPerson()
 {
     _indPeople.OnSet();
     Person person = new Person();
     _people.Add(person);
     return person;
 }
コード例 #2
0
 public static PersonViewModel Wrap(Person person, ContactList contactList)
 {
     if (person == null)
         return null;
     else
         return new PersonViewModel(person, contactList);
 }
コード例 #3
0
ファイル: Person.cs プロジェクト: CadeLaRen/UpdateControls
        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;
            }
        }
コード例 #4
0
        public void EndEdit()
        {
            if (_copy != _person)
            {
                _person.First = _copy.First;
                _person.Last = _copy.Last;
                _person.Prefix = _copy.Prefix;
                _person.Gender = _copy.Gender;

                _copy = _person;
            }
        }
コード例 #5
0
 public void CancelEdit()
 {
     _copy = _person;
 }
コード例 #6
0
 public void BeginEdit()
 {
     _copy = new Person()
     {
         First = _person.First,
         Last = _person.Last,
         Prefix = _person.Prefix,
         Gender = _person.Gender
     };
 }
コード例 #7
0
 public DataGridPersonViewModel(Person person, ContactList contactList)
 {
     _person = person;
     _copy = _person;
     _contactList = contactList;
 }
コード例 #8
0
 public PersonViewModelBase(Person person)
 {
     _person = person;
 }
コード例 #9
0
 public PersonViewModel(Person person, ContactList contactList)
     : base(person)
 {
     _contactList = contactList;
 }
コード例 #10
0
 public static SpouseViewModel Wrap(Person spouse)
 {
     return new SpouseViewModel(spouse);
 }
コード例 #11
0
 private SpouseViewModel(Person spouse)
 {
     _spouse = spouse;
 }
コード例 #12
0
 public void DeletePerson(Person person)
 {
     _indPeople.OnSet();
     _people.Remove(person);
 }