Esempio n. 1
0
 private void OnOpenRecentAccountCommand(RecentAccountViewModel account)
 {
     try
     {
         Application.Repository.Open(account.Path);
         var createdRequests = UpdateStandingOrdersToCurrentMonth();
         Application.ActivateRequestmanagementPage(createdRequests);
     }
     catch (FileLockedException)
     {
         var message = string.Format(Properties.Resources.RecentAccountLockedFormat, account.Path);
         Application.WindowManager.ShowError(Properties.Resources.ErrorOpenRecentAccount, message);
     }
     catch (FileNotFoundException)
     {
         var message = string.Format(Properties.Resources.RecentAccountNotFoundFormat, account.Path);
         Application.WindowManager.ShowQuestion(Properties.Resources.ErrorOpenRecentAccount,
                                                message,
                                                () =>
         {
             Application.ApplicationContext.DeleteRecentAccountInformation(account.Path);
             _accounts.Remove(account);
         }, () => { });
     }
     catch (Exception ex)
     {
         var message = string.Format(Properties.Resources.RecentAccountUnexpectedErrorFormat, ex.Message);
         Application.WindowManager.ShowError(Properties.Resources.ErrorOpenRecentAccount, message);
     }
 }
        public void InitialState()
        {
            var viewModel = new RecentAccountViewModel(r => {}, r => {}) {LastAccessDate = new DateTime(2014, 4, 4)};

            var expectedLastAccessDateAsString = string.Format(Properties.Resources.LastAccesDateFormat, new DateTime(2014, 4, 4));
            Assert.That(viewModel.LastAccessDateAsString, Is.EqualTo(expectedLastAccessDateAsString));
        }
Esempio n. 3
0
 private void OnRemoveRecentAccountCommand(RecentAccountViewModel account)
 {
     Application.WindowManager.ShowQuestion(Properties.Resources.AccountManagementRemoveAccountCaption,
                                            Properties.Resources.AccountManagementRemoveAccountMessage,
                                            () =>
     {
         Application.ApplicationContext.DeleteRecentAccountInformation(account.Path);
         _accounts.Remove(account);
     }, () => { });
 }
 private void OnRemoveRecentAccountCommand(RecentAccountViewModel account)
 {
     Application.WindowManager.ShowQuestion(Properties.Resources.AccountManagementRemoveAccountCaption,
                                            Properties.Resources.AccountManagementRemoveAccountMessage,
     () =>
     {
         Application.ApplicationContext.DeleteRecentAccountInformation(account.Path);
         _accounts.Remove(account);
     }, () => { });
 }
 private void OnOpenRecentAccountCommand(RecentAccountViewModel account)
 {
     try
     {
         Application.Repository.Open(account.Path);
         var createdRequests = Application.Repository.UpdateStandingOrdersToCurrentMonth();
         Application.ActivateRequestmanagementPage(createdRequests);
     }
     catch (FileLockedException)
     {
         var message = string.Format(Properties.Resources.RecentAccountLockedFormat, account.Path);
         Application.WindowManager.ShowError(Properties.Resources.ErrorOpenRecentAccount, message);
     }
     catch (FileNotFoundException)
     {
         var message = string.Format(Properties.Resources.RecentAccountNotFoundFormat, account.Path);
         Application.WindowManager.ShowQuestion(Properties.Resources.ErrorOpenRecentAccount,
                                                message,
                                                 () =>
                                                 {
                                                     Application.ApplicationContext.DeleteRecentAccountInformation(account.Path);
                                                     _accounts.Remove(account);
                                                 }, () => { });
     }
     catch (Exception ex)
     {
         var message = string.Format(Properties.Resources.RecentAccountUnexpectedErrorFormat, ex.Message);
         Application.WindowManager.ShowError(Properties.Resources.ErrorOpenRecentAccount, message);
     }
 }