コード例 #1
0
        public void Execute()
        {
            IEnumerable <Contact> contacts;

            try
            {
                contacts = _contactsProvider.GetAll();
            }
            catch (Exception)
            {
                throw new Exception("Cannot load contacts sever.");
            }

            _eventAggregator.Publish(new ContactsLoaded(contacts));
        }
コード例 #2
0
        private void UpdateContacts(object sender, ElapsedEventArgs elapsedEventArgs)
        {
            IEnumerable <Contact> contacts;

            try
            {
                contacts = _contactsProvider.GetAll();;
            }
            catch (Exception)
            {
                Thread.CurrentThread.Abort();
                return;
            }

            _eventAggregator.Publish(new ContactsDataReceived(contacts, false));
        }