예제 #1
0
        private void Initialize()
        {
            _view.BackButtonClicked  += new EventHandler(OnBackButtonClicked);
            _view.CloseButtonClicked += new EventHandler(OnCloseButtonClicked);
            _view.CreateNewPersonDataButtonClicked += new EventHandler(OnCreateNewPersonClicked);
            _view.PersonSelectedFromList           += new EventHandler(OnPersonSelected);
            _view.NewPersonCreatingClicked         += new EventHandler(OnNewPersonCreatingClicked);
            _view.UpdatePersonCliked        += new EventHandler(OnUpdatePersonCliked);
            _view.SelectPersonButtonClicked += new EventHandler(OnSelectPersonButtonClicked);
            _view.AddPhotoButtonClicked     += new EventHandler(OnAddPhotoButtonCicked);

            // Make the appropriate comparer.
            PersonComparer pc = new PersonComparer
            {
                SortBy = PersonComparer.CompareField.BirthDate
            };

            List <Person> SortedList = _data.GetPersonsCatalog().ToList();

            SortedList.Sort(pc);

            foreach (var person in SortedList)
            {
                _view.AddPersonToList(person);
            }
        }
예제 #2
0
        private void Initialize()
        {
            _view.BackButtonClicked  += new EventHandler(OnBackButtonClicked);
            _view.CloseButtonClicked += new EventHandler(OnCloseButtonClicked);
            _view.CreateNewPersonDataButtonClicked += new EventHandler(OnCreateNewPersonClicked);
            _view.PersonSelectedFromList           += new EventHandler(OnPersonSelected);
            _view.NewPersonCreatingClicked         += new EventHandler(OnNewPersonCreatingClicked);
            _view.UpdatePersonCliked        += new EventHandler(OnUpdatePersonCliked);
            _view.SelectPersonButtonClicked += new EventHandler(OnSelectPersonButtonClicked);
            _view.AddPhotoButtonClicked     += new EventHandler(OnAddPhotoButtonCicked);

            foreach (var person in FirstPageView.persons)
            {
                _view.AddPersonToList(person.Name);
            }
        }