private void SaveMenuItem_Click(object sender, RoutedEventArgs e) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Title = "Збереження"; saveFileDialog.FileName = "Звіт"; saveFileDialog.DefaultExt = ".docx"; saveFileDialog.Filter = "Word files (.doc)|*.docx"; saveFileDialog.InitialDirectory = Environment.CurrentDirectory + @"\saves"; if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ReportController reportController = new ReportController { WeatherController = _weatherController, SunConditionController = _sunConditionController, DeviceController = _deviceController, DeviceOpt2Controller = ElectricalLoadScheduleView.OptimizationView.Device2ZoneOptController, DeviceOpt3Controller = ElectricalLoadScheduleView.OptimizationView.Device3ZoneOptController, HouseController = _houseController, WindEnergyController = _windEnergyController, HeatPumpController = _heatPumpController, HeatStoreController = _heatStoreController }; reportController.CopyData(); reportController.Report.ImgDirectory = _imagesDirectory; MeteorogicalAnalysisView.SaveCharts(_weatherChartPaths); reportController.Report.Weather.ImgPaths = _weatherChartPaths; ElectricalLoadScheduleView.SaveCharts(_elLoadChartPaths, _elLoadOpt2ChartPaths, _elLoadOpt3ChartPaths); reportController.Report.ElectricalLoadSchedule.ImgPaths = _elLoadChartPaths; reportController.Report.Opt2ElectricalLoadSchedule.ImgPaths = _elLoadOpt2ChartPaths; reportController.Report.Opt3ElectricalLoadSchedule.ImgPaths = _elLoadOpt3ChartPaths; reportController.Report.ThermalEnergy.CommonImgPaths = _commonHeatingPaths; reportController.Report.ThermalEnergy.IndividualImgPaths = _individualHeatingPaths; ThermalEnergy.SaveCharts(_commonHeatingPaths, _individualHeatingPaths); reportController.Report.Wind.ImgPaths = _windEnergyPaths; WindEnergyView.SaveCharts(_windEnergyPaths); reportController.Report.HeatPump.ImgPaths = _heatPumpPaths; HeatPumpView.SaveCharts(_heatPumpPaths); reportController.Report.HeatStore.ImgPaths = _heatStorePaths; HeatStoreView.SaveCharts(_heatStorePaths); ReportWordController reportWordController = new ReportWordController { Report = reportController.Report }; string path = System.IO.Path.GetFullPath(saveFileDialog.FileName); ProgressBarWindow progressBarWindow = new ProgressBarWindow(reportWordController, path); progressBarWindow.Show(); } }