Beispiel #1
0
        public async Task LoadAsync(ApplicationDatabase applicationDatabase)
        {
            this.matchingRules.Clear();
            this.matchingRulesGroupedByBucket.Clear();
            this.rulesStorageKey = applicationDatabase.FullPath(applicationDatabase.MatchingRulesCollectionStorageKey);
            List <MatchingRule> repoRules;

            try
            {
                repoRules = (await this.ruleRepository.LoadAsync(this.rulesStorageKey, applicationDatabase.IsEncrypted))
                            .OrderBy(r => r.Description)
                            .ToList();
            }
            catch (FileNotFoundException)
            {
                // If file not found occurs here, assume this is the first time the app has run, and create a new one.
                this.rulesStorageKey = await BuildDefaultFileName();

                repoRules = this.ruleRepository.CreateNew().ToList();
            }

            InitialiseTheRulesCollections(repoRules);

            this.monitorableDependencies.NotifyOfDependencyChange <ITransactionRuleService>(this);
            NewDataSourceAvailable?.Invoke(this, EventArgs.Empty);
        }
        public async Task LoadAsync(ApplicationDatabase applicationDatabase)
        {
            if (applicationDatabase == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabase));
            }

            Budgets = await this.budgetRepository.LoadAsync(applicationDatabase.FullPath(applicationDatabase.BudgetCollectionStorageKey), applicationDatabase.IsEncrypted);

            UpdateServiceMonitor();
            NewDataSourceAvailable?.Invoke(this, EventArgs.Empty);
        }
        public async Task LoadAsync(ApplicationDatabase applicationDatabase)
        {
            if (applicationDatabase == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabase));
            }

            LedgerBook = await this.ledgerRepository.LoadAsync(applicationDatabase.FullPath(applicationDatabase.LedgerBookStorageKey), applicationDatabase.IsEncrypted);

            this.monitorableDependencies.NotifyOfDependencyChange(LedgerBook);
            NewDataSourceAvailable?.Invoke(this, EventArgs.Empty);
        }
 private void NewDataAvailable()
 {
     ResetTransactionsCollection();
     this.monitorableDependencies.NotifyOfDependencyChange(StatementModel);
     NewDataSourceAvailable?.Invoke(this, EventArgs.Empty);
 }