コード例 #1
0
        private void CreateBackup()
        {
            DateTime now      = DateTime.Now;
            string   filePath = _savingFilePathSelector.GetFilePath(
                string.Format("Záloha dat - {0}-{1}-{2}", now.Day, now.Month, now.Year),
                obj => {
                SaveFileDialog d = (SaveFileDialog)obj;
                d.Filter         = "Evidoo data (*.evdo)|*.evdo";
            }
                );

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }

            ProgressBarWindowViewModel pb = new ProgressBarWindowViewModel();

            Task.Run(async() => {
                _settingFacade.BackupData(filePath);

                pb.Success = true;
                await Task.Delay(pb.ResultIconDelay);

                pb.TryClose();
            });

            _windowManager.ShowDialog(pb);
        }
コード例 #2
0
        private void CreateBackup()
        {
            DateTime now      = DateTime.Now;
            string   filePath = _filePathDialogService.GetFilePath <SaveFileDialog>(
                string.Format("Záloha dat - {0}-{1}-{2}", now.Day, now.Month, now.Year),
                d => { d.Filter = "Evidoo data (*.evdo)|*.evdo"; }
                );

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }

            IOverlayToken ot = Overlay.DisplayOverlay(PrepareViewModel <ProgressViewModel>(), true);

            Task.Run(() => {
                ResultObject <object> ro = _settingFacade.BackupData(filePath);

                ot.HideOverlay();
                EventAggregator.PublishOnUIThread(new BackupSuccessfullyCreatedMessage());
            });
        }