/// <summary> /// Наш MVVM Патерн /// </summary> /// <param name="detal"></param> public DataDatalization(Detalizacia detal) { var logic = new Logica.Logica(); var contextlogic = new SobytieAndCommandContext.ContextCommand(); var sobytie = new SobytieAndCommandContext.SobytieReport(); var sobytiedbf = new SobytieAndCommandContext.SobytieDbfFile(); Service = new WpfBakcupStart.ContentBakcup.Service.VoidService(); Dialog = new VoidDialog(Service); Years = new AddColection.AddColection().Years(); PanelUl = new SelectPanelUl(); PanelFl = new SelectPanelFl(); Trigers = new TrigersUse(); Tab = new TabControl(); IsSelectedFace = new DelegateCommand(() => Trigers.IsSelectFace()); ListFilesDbf = new ListFilesDbf(); ListReport = new AddColection.AddColection().Report(); Seath = new DelegateCommand(() => Dispatcher.CurrentDispatcher.Invoke(() => logic.Go(detal, Trigers, PanelUl, PanelFl, Years, ListFilesDbf, Tab, ListReport))); RemoveReport = new DelegateCommand(() => contextlogic.RemoveReport(ListReport.Report, ListReport.ShemesFilesReport)); OpenReport = new DelegateCommand(() => contextlogic.OpenReport(ListReport.Report)); FileDropDrapReport = new DelegateCommand <object>(parameter => sobytie.MoveCopy(parameter, ListReport.Report)); FileOpenEvent = new DelegateCommand(() => sobytie.OpenReportEvent(ListReport.Report)); FileOpenDbf = new DelegateCommand((() => sobytiedbf.OpenDbfEvent(ListFilesDbf.FileDbf))); FileDropDrapDbf = new DelegateCommand <object>(parameter => sobytiedbf.MoveCopyDbf(parameter, ListFilesDbf.FileDbf)); OpenDialogWcfBackup = new DelegateCommand <object>((parameter => { Service.SelectDialog(Convert.ToString(parameter), Dialog); })); }
public void MoveCopyDbf(object parametr, ListFilesDbf file) { if (Mouse.LeftButton == MouseButtonState.Pressed) { var objectiv = (ListView)parametr; var files = new String[1]; files[0] = file.Path; var data = new DataObject(); data.SetData(DataFormats.FileDrop, files); DragDrop.DoDragDrop(objectiv, data, DragDropEffects.Copy); } }
public void Go(Detalizacia detal, TrigersUse trigerselect, SelectPanelUl ul, SelectPanelFl fl, YearsDbf years, ListFilesDbf filedbf, Collections.ColectionTab.TabControl tab, ListFileReport report) { ReaderCommandDbfClient service = new ReaderCommandDbfClient("BasicHttpBinding_IReaderCommandDbf"); DispatcherHelper.Initialize(); Triger = trigerselect; Ul = ul; Fl = fl; Yers = years; Detal = detal; ListFile = filedbf; Report = report; Tab = tab; if (service.IsActive()) { if (Yers.IsValidation()) { if (Triger.IsCheked) { if (!Fl.IsValidation()) { Triger.IsEnableButtonFl = false; WorkerFl.WorkerReportsProgress = true; WorkerFl.WorkerSupportsCancellation = true; WorkerFl.DoWork += worker_DoworkFL; WorkerFl.ProgressChanged += worker_progressChangeFL; WorkerFl.RunWorkerCompleted += worker_RunWorkerCompleteFL; WorkerFl.RunWorkerAsync(); } } else { if (!Ul.IsValidation()) { Triger.IsEnableButtonUl = false; WorkerUl.WorkerReportsProgress = true; WorkerUl.WorkerSupportsCancellation = true; WorkerUl.DoWork += worker_DoworkUL; WorkerUl.ProgressChanged += worker_progressChangeUL; WorkerUl.RunWorkerCompleted += worker_RunWorkerCompleteUL; WorkerUl.RunWorkerAsync(); } } } } else { System.Windows.Forms.MessageBox.Show( @"Ошибка сервис не может принять запрос в связи с резервным копированием"); } }
public void FilesDbf(ObservableCollection <FileInfo[]> files, ListFilesDbf dbffiles, string usefile) { lock (dbffiles._lock) { foreach (var fileInfose in files) { foreach (var fileInfo in fileInfose) { DispatcherHelper.CheckBeginInvokeOnUI(() => { dbffiles.ShemesFiles.Add(new ListFilesDbf { Icon = IconsDetalization.Icons.Extracticonfile(fileInfo.FullName), Name = fileInfo.Name, Path = fileInfo.FullName, FileUse = usefile }); }); } } } }
public void OpenDbfEvent(ListFilesDbf reportxsl) { var openfile = new OpenFile.OpenFile(); openfile.Openxls(reportxsl.Path); }