public StatementControllerNavigation(
            [NotNull] IMessenger messenger, 
            [NotNull] StatementController controller, 
            [NotNull] IUserQuestionBoxYesNo questionBox)
        {
            if (messenger == null)
            {
                throw new ArgumentNullException("messenger");
            }

            if (controller == null)
            {
                throw new ArgumentNullException("controller");
            }
            
            if (questionBox == null)
            {
                throw new ArgumentNullException("questionBox");
            }

            MessengerInstance = messenger;
            this.controller = controller;
            this.questionBox = questionBox;

            MessengerInstance.Register<NavigateToTransactionMessage>(this, OnNavigateToTransactionRequestReceived);
        }
        public RulesController([NotNull] IUiContext uiContext, [NotNull] ITransactionRuleService ruleService, [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (ruleService == null)
            {
                throw new ArgumentNullException(nameof(ruleService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            this.ruleService = ruleService;
            this.applicationDatabaseService = applicationDatabaseService;

            this.questionBox  = uiContext.UserPrompts.YesNoBox;
            NewRuleController = uiContext.NewRuleController;
            MessengerInstance = uiContext.Messenger;

            this.ruleService.Closed += OnClosedNotificationReceived;
            this.ruleService.NewDataSourceAvailable += OnNewDataSourceAvailableNotificationReceived;
            this.ruleService.Saved += OnSavedNotificationReceived;
        }
        public StatementControllerNavigation(
            [NotNull] IMessenger messenger,
            [NotNull] StatementController controller,
            [NotNull] IUserQuestionBoxYesNo questionBox)
        {
            if (messenger == null)
            {
                throw new ArgumentNullException(nameof(messenger));
            }

            if (controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }

            if (questionBox == null)
            {
                throw new ArgumentNullException(nameof(questionBox));
            }

            MessengerInstance = messenger;
            this.controller   = controller;
            this.questionBox  = questionBox;

            MessengerInstance.Register <NavigateToTransactionMessage>(this, OnNavigateToTransactionRequestReceived);
        }
示例#4
0
        public RulesController([NotNull] IUiContext uiContext, [NotNull] ITransactionRuleService ruleService, [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (ruleService == null)
            {
                throw new ArgumentNullException(nameof(ruleService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            this.ruleService = ruleService;
            this.applicationDatabaseService = applicationDatabaseService;

            this.questionBox = uiContext.UserPrompts.YesNoBox;
            NewRuleController = uiContext.NewRuleController;
            MessengerInstance = uiContext.Messenger;

            this.ruleService.Closed += OnClosedNotificationReceived;
            this.ruleService.NewDataSourceAvailable += OnNewDataSourceAvailableNotificationReceived;
            this.ruleService.Saved += OnSavedNotificationReceived;
        }
示例#5
0
        public LedgerBookController(
            [NotNull] UiContext uiContext,
            [NotNull] LedgerBookControllerFileOperations fileOperations,
            [NotNull] LedgerBookGridBuilderFactory uiBuilder,
            [NotNull] ILedgerService ledgerService,
            [NotNull] IReconciliationService reconService,
            [NotNull] NewWindowViewLoader newWindowViewLoader)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (fileOperations == null)
            {
                throw new ArgumentNullException(nameof(fileOperations));
            }

            if (uiBuilder == null)
            {
                throw new ArgumentNullException(nameof(uiBuilder));
            }

            if (ledgerService == null)
            {
                throw new ArgumentNullException(nameof(ledgerService));
            }

            if (reconService == null)
            {
                throw new ArgumentNullException(nameof(reconService));
            }

            if (newWindowViewLoader == null)
            {
                throw new ArgumentNullException(nameof(newWindowViewLoader));
            }

            this.uiBuilder                    = uiBuilder;
            this.ledgerService                = ledgerService;
            this.reconService                 = reconService;
            this.newWindowViewLoader          = newWindowViewLoader;
            this.messageBox                   = uiContext.UserPrompts.MessageBox;
            this.questionBox                  = uiContext.UserPrompts.YesNoBox;
            this.inputBox                     = uiContext.UserPrompts.InputBox;
            FileOperations                    = fileOperations;
            FileOperations.LedgerService      = this.ledgerService;
            this.uiContext                    = uiContext;
            this.doNotUseNumberOfMonthsToShow = 2;

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register <BudgetReadyMessage>(this, OnBudgetReadyMessageReceived);
            MessengerInstance.Register <StatementReadyMessage>(this, OnStatementReadyMessageReceived);

            this.ledgerService.Saved  += OnSaveNotificationReceieved;
            this.ledgerService.Closed += OnClosedNotificationReceived;
            this.ledgerService.NewDataSourceAvailable += OnNewDataSourceAvailableNotificationReceived;
        }
        public EncryptFileController([NotNull] IUiContext uiContext, [NotNull] IApplicationDatabaseService appDbService)
        {
            this.appDbService = appDbService;
            if (uiContext == null) throw new ArgumentNullException(nameof(uiContext));
            if (appDbService == null) throw new ArgumentNullException(nameof(appDbService));
            this.questionService = uiContext.UserPrompts.YesNoBox;
            this.messageService = uiContext.UserPrompts.MessageBox;

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register<WidgetActivatedMessage>(this, OnWidgetActivatedMessageReceived);
            MessengerInstance.Register<ShellDialogResponseMessage>(this, OnShellDiaglogResponseMessageReceived);
        }
        public BudgetController(
            [NotNull] IBudgetRepository budgetRepository,
            [NotNull] UiContext uiContext,
            [NotNull] DemoFileHelper demoFileHelper,
            [NotNull] IBudgetBucketRepository bucketRepo)
        {
            if (budgetRepository == null)
            {
                throw new ArgumentNullException("budgetRepository");
            }

            if (uiContext == null)
            {
                throw new ArgumentNullException("uiContext");
            }

            if (demoFileHelper == null)
            {
                throw new ArgumentNullException("demoFileHelper");
            }

            if (bucketRepo == null)
            {
                throw new ArgumentNullException("bucketRepo");
            }

            this.demoFileHelper = demoFileHelper;
            this.bucketRepo = bucketRepo;
            this.budgetRepository = budgetRepository;
            this.questionBox = uiContext.UserPrompts.YesNoBox;
            this.messageBox = uiContext.UserPrompts.MessageBox;
            this.fileOpenDialogFactory = uiContext.UserPrompts.OpenFileFactory;
            this.fileSaveDialogFactory = uiContext.UserPrompts.SaveFileFactory;
            this.inputBox = uiContext.UserPrompts.InputBox;
            BudgetPieController = uiContext.BudgetPieController;
            Shown = false;

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register<ApplicationStateRequestedMessage>(this, OnApplicationStateRequested);
            MessengerInstance.Register<ApplicationStateLoadedMessage>(this, OnApplicationStateLoaded);
            MessengerInstance.Register<ShellDialogResponseMessage>(this, OnPopUpResponseReceived);

            var budget = new BudgetModel();
            CurrentBudget = new BudgetCurrencyContext(new BudgetCollection(new[] { budget }), budget);
        }
        public EncryptFileController([NotNull] IUiContext uiContext, [NotNull] IApplicationDatabaseService appDbService)
        {
            this.appDbService = appDbService;
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }
            if (appDbService == null)
            {
                throw new ArgumentNullException(nameof(appDbService));
            }
            this.questionService = uiContext.UserPrompts.YesNoBox;
            this.messageService  = uiContext.UserPrompts.MessageBox;

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register <WidgetActivatedMessage>(this, OnWidgetActivatedMessageReceived);
            MessengerInstance.Register <ShellDialogResponseMessage>(this, OnShellDiaglogResponseMessageReceived);
        }
        public RulesController(
            [NotNull] UiContext uiContext,
            [NotNull] IMatchingRuleRepository ruleRepository)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException("uiContext");
            }

            this.logger = uiContext.Logger;
            this.questionBox = uiContext.UserPrompts.YesNoBox;
            this.ruleRepository = ruleRepository;
            NewRuleController = uiContext.NewRuleController;
            RulesGroupedByBucket = new ObservableCollection<RulesGroupedByBucket>();

            MessengerInstance = uiContext.Messenger;
            uiContext.Messenger.Register<ApplicationStateRequestedMessage>(this, OnApplicationStateRequested);
            uiContext.Messenger.Register<ApplicationStateLoadedMessage>(this, OnApplicationStateLoaded);
        }
示例#10
0
        public BudgetController(
            [NotNull] UiContext uiContext,
            [NotNull] IBudgetMaintenanceService maintenanceService,
            [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (maintenanceService == null)
            {
                throw new ArgumentNullException(nameof(maintenanceService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            this.maintenanceService = maintenanceService;
            this.applicationDatabaseService = applicationDatabaseService;
            this.questionBox = uiContext.UserPrompts.YesNoBox;
            this.messageBox = uiContext.UserPrompts.MessageBox;
            this.inputBox = uiContext.UserPrompts.InputBox;
            BudgetPieController = uiContext.BudgetPieController;
            NewBudgetController = uiContext.NewBudgetModelController;
            NewBudgetController.Ready += OnAddNewBudgetReady;
            Shown = false;

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register<ShellDialogResponseMessage>(this, OnPopUpResponseReceived);
            this.maintenanceService.Closed += OnClosedNotificationReceived;
            this.maintenanceService.NewDataSourceAvailable += OnNewDataSourceAvailableNotificationReceived;
            this.maintenanceService.Saving += OnSavingNotificationReceived;
            this.maintenanceService.Validating += OnValidatingNotificationReceived;
            this.maintenanceService.Saved += OnSavedNotificationReceived;

            CurrentBudget = new BudgetCurrencyContext(this.maintenanceService.Budgets, this.maintenanceService.Budgets.CurrentActiveBudget);
        }
        public BudgetController(
            [NotNull] UiContext uiContext,
            [NotNull] IBudgetMaintenanceService maintenanceService,
            [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (maintenanceService == null)
            {
                throw new ArgumentNullException(nameof(maintenanceService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            this.maintenanceService         = maintenanceService;
            this.applicationDatabaseService = applicationDatabaseService;
            this.questionBox           = uiContext.UserPrompts.YesNoBox;
            this.messageBox            = uiContext.UserPrompts.MessageBox;
            this.inputBox              = uiContext.UserPrompts.InputBox;
            BudgetPieController        = uiContext.BudgetPieController;
            NewBudgetController        = uiContext.NewBudgetModelController;
            NewBudgetController.Ready += OnAddNewBudgetReady;
            Shown = false;

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register <ShellDialogResponseMessage>(this, OnPopUpResponseReceived);
            this.maintenanceService.Closed += OnClosedNotificationReceived;
            this.maintenanceService.NewDataSourceAvailable += OnNewDataSourceAvailableNotificationReceived;
            this.maintenanceService.Saving     += OnSavingNotificationReceived;
            this.maintenanceService.Validating += OnValidatingNotificationReceived;
            this.maintenanceService.Saved      += OnSavedNotificationReceived;

            CurrentBudget = new BudgetCurrencyContext(this.maintenanceService.Budgets, this.maintenanceService.Budgets.CurrentActiveBudget);
        }
示例#12
0
        public UserPrompts(
            [NotNull] IUserMessageBox messageBox,
            [NotNull] Func <IUserPromptOpenFile> openFileFactory,
            [NotNull] Func <IUserPromptSaveFile> saveFileFactory,
            [NotNull] IUserQuestionBoxYesNo yesNoBox,
            [NotNull] IUserInputBox inputBox)
        {
            if (messageBox == null)
            {
                throw new ArgumentNullException(nameof(messageBox));
            }

            if (openFileFactory == null)
            {
                throw new ArgumentNullException(nameof(openFileFactory));
            }

            if (saveFileFactory == null)
            {
                throw new ArgumentNullException(nameof(saveFileFactory));
            }

            if (yesNoBox == null)
            {
                throw new ArgumentNullException(nameof(yesNoBox));
            }

            if (inputBox == null)
            {
                throw new ArgumentNullException(nameof(inputBox));
            }

            OpenFileFactory = openFileFactory;
            SaveFileFactory = saveFileFactory;
            MessageBox      = messageBox;
            YesNoBox        = yesNoBox;
            InputBox        = inputBox;
        }
        public LedgerBookControllerFileOperations(
            [NotNull] UiContext uiContext,
            [NotNull] IMessenger messenger,
            [NotNull] ILedgerBookRepository ledgerBookRepository,
            [NotNull] DemoFileHelper demoFileHelper)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException("uiContext");
            }

            if (messenger == null)
            {
                throw new ArgumentNullException("messenger");
            }

            if (ledgerBookRepository == null)
            {
                throw new ArgumentNullException("ledgerBookRepository");
            }

            if (demoFileHelper == null)
            {
                throw new ArgumentNullException("demoFileHelper");
            }

            this.saveFileDialogFactory = uiContext.UserPrompts.SaveFileFactory;
            this.openFileDialogFactory = uiContext.UserPrompts.OpenFileFactory;
            this.questionBox = uiContext.UserPrompts.YesNoBox;
            this.messageBox = uiContext.UserPrompts.MessageBox;

            this.waitCursorFactory = uiContext.WaitCursorFactory;
            this.ledgerRepository = ledgerBookRepository;
            this.demoFileHelper = demoFileHelper;
            MessengerInstance = messenger;

            ViewModel = new LedgerBookViewModel();
        }