Beispiel #1
0
        static void Main()
        {
            IAccountTagRepository accountTagRepository = InitialiseAccountTagRepository("Data/accountTags.xml");
            IAccountRepository accountRepository = InitialiseAccountRepository("Data/accounts.xml", accountTagRepository);
            IJournalRepository journalRepository = InitialiseJournalRepository("Data/Journals.xml", accountRepository);

            var importer = new SpreadsheetImporter(accountTagRepository, accountRepository, journalRepository);
            importer.ImportSpreadsheet("MigrationData.xls");

            var fileWriter = new FileWriter(accountRepository, null, null, journalRepository);
            fileWriter.WriteAccountFile(@".\\Data");
            fileWriter.WriteJournalFile(@".\\Data");
        }
        public MainWindowViewModel(IAccountRepository accountRepository, IAccountTagRepository accountTagRepository, 
                                   IJournalRepository journalRepository, ITemplateRepository templateRepository)
        {
            _accountTagRepository = accountTagRepository;
            _accountRepository = accountRepository;
            _journalRepository = journalRepository;
            _templateRepository = templateRepository;

            _accountTagRepository.RepositoryModified += OnRepositoryModified;
            _accountRepository.RepositoryModified += OnRepositoryModified;
            _journalRepository.RepositoryModified += OnRepositoryModified;
            _templateRepository.RepositoryModified += OnRepositoryModified;

            _fileWriter = new FileWriter(_accountRepository, accountTagRepository, _templateRepository, _journalRepository);

            _monthlyBreakdownScreenOpener = new ScreenOpener(OpenMonthlyBreakdownScreen);
            _accountBrowserScreenOpener = new ScreenOpener(OpenAccountBrowserScreen);
            _accountMaintenanceScreenOpener = new ScreenOpener(OpenAccountMaintenanceScreen);
            _templateScreenOpener = new ScreenOpener(OpenTemplateScreen);

            base.DisplayName = "Akcounts";
        }