예제 #1
0
        public StatementsViewModel(IContext context, IParser[] supportedParsers, 
            IResolveClassificationConflicts resolveConflicts, IMessageBoxService messageBoxService)
        {
            _context = context;
            _operationRepository = context.GetRepository<IRepository<BankOperation>>();
            _statementsRepository = context.GetRepository<IRepository<BankStatement>>();

            _supportedParsers = supportedParsers.OrderBy(a => a.Name);
            _importer = new OperationsImporter(_operationRepository, _statementsRepository);
            _messageBoxService = messageBoxService;
            _resolveConflicts = resolveConflicts;

            ApplyRules = true;
            ChosenParser = SupportedParsers.FirstOrDefault();
            ResetListData();

            LoadFileCommand = new DelegateCommand(LoadFromFile);
            LoadRawTextCommand = new DelegateCommand(DoLoadFromRawText, CanLoadFromRawText);
            DeleteStatementCommand = new DelegateCommand(DeleteSelected, CanDelete);
        }