private void OnConvertClick(Income income)
        {
            _income = income;
            Global.Instance.CurrentType = _income.Type;
            _view.ConvertButtonEnabled = false;
            _view.StopButtonEnabled = true;

            _excelConverter = new ExcelConverter(income.Type);
            _excelConverter.SetProgressBarValue += Converter_SetProgressBarValue;
            _excelConverter.PrintStatus += ExcelCommander_PrintStatus;
            _excelConverter.PrintMessage += _view.PrintLog;
            _excelConverter.OperationCompleted += Converter_OperationCompleted;

            _backgroundWorker = new BackgroundWorker() {WorkerSupportsCancellation = true};
            _backgroundWorker.DoWork += _backgroundWorker_DoWork;
            _backgroundWorker.RunWorkerAsync();
        }
Пример #2
0
        public static void Test()
        {
            //Income testIncome = new Income()
            //{
            //    FilePath = @"e:\Projects\SportproConverter\Docs\Test\Склад03.08.2015.xls",
            //    Type = Global.Instance.IncomeFileTypes.Find(t => t.Id == 1)
            //};

            Income testDinamo = new Income()
            {
                FilePath = @"e:\Projects\SportproConverter\Docs\Test\Остатки ДИНАМО.xlsx",
                Type = Global.Instance.IncomeFileTypes.Find(t => t.Description == "Динамо")
            };

            IExcelConverter converter = new ExcelConverter(testDinamo.Type);

            converter.Convert(testDinamo);
            converter.CloseApp();
        }