public void ShowErrorMsg(string errorText) { if (_msgBox != null) { SystemContext.Instance.AsyncOperation.SynchronizationContext.Post( state => { _msgBox.ShowErrorMsg(errorText); }, null); } else { MessageBox.Show(errorText, "提示"); } }
private void Start() { //开始镜像前,检测剩余空间 long freeValue = _driverInfo.GetTargetDriverFreeSpace(TargetPosition.DirPath); if (freeValue <= SourcePosition.CurrentSelectedDisk.SelectedTotalSize * 1.1) { _msgBox.ShowErrorMsg(string.Format("目录{0}所在的磁盘空间不足以存放镜像后的数据", TargetPosition.DirPath)); return; } //开始镜像 if (SourcePosition.CurrentSelectedDisk.Items != null) { ProgressPosition.TotalSize = SourcePosition.CurrentSelectedDisk.SelectedTotalSize; ProgressPosition.Start(); } SourcePosition.Start(TargetPosition.DirPath); SourcePosition.IsMirroring = true; }
//完成选择【确定按钮】 private void ExecuteSelectedCompleteCommand() { if (_curSelectedItem != null) { if (_curSelectedItem.IsFolder) { //进入文件夹 UpdateFolders(SelectManager.InFolderAndUpdateLevel(_curSelectedItem)); } else { if (File.Exists(CurSelectedItemInFolder.FullPath)) { base.DialogResult = true; CloseView(); } else { //不存在提示 _msgService.ShowErrorMsg("打开路径不存在"); } } } }