private async void SaveClickAsyns() { Controller.Convertor.ErrorType errors = Controller.Convertor.ErrorType.NoErros; if (!System.IO.Directory.Exists(FilePath)) { swApp.SendMsgToUser("当前路径不存在:" + FilePath); return; } var model = Controller.Convertor.DuConvertor.ConvertToglTFModel(swModel, out errors); if (model != null) { Controller.Convertor.DuConvertor.SaveAs(model, FilePath, FileName); } swApp.SendMsgToUser("保存完成"); }
/// <summary> /// 保存按钮执行的动作 /// </summary> private void SaveClick() { List <string> files = null; Controller.Convertor.ErrorType errors = Controller.Convertor.ErrorType.NoErros; IsInProgress = true; if (!System.IO.Directory.Exists(FilePath)) { swApp.SendMsgToUser("当前路径不存在:" + FilePath); return; } if (FilePath.Contains("-") || FileName.Contains("-")) { swApp.SendMsgToUser("-为非法字符,路径或者文件民包含-字符,请修改路径或者文件名后重新保存"); return; } try { //会堵塞UI;TODO:异步方式实现转换 var model = Controller.Convertor.DuConvertor.ConvertToglTFModel(swModel, out errors); if (model != null) { files = Controller.Convertor.DuConvertor.SaveAs(model, FilePath, FileName); } swApp.SendMsgToUser("保存完成"); if (files != null && IsOpenFile && files.Count >= 3) { System.Diagnostics.Process.Start(files[2]); } if (IsOpenFolder) { System.Diagnostics.Process.Start("explorer.exe", FilePath); } IsInProgress = false; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } // System.Diagnostics.Process.Start("ExpLore", "C:\\window"); }
private void DuConvertor_ProgressStatus_event(double Value, string Status, Controller.Convertor.ErrorType error) { ProgressBarValue = Value; }