public void OpenProject() { var open = new OpenWindow() { Owner = this }; open.OpenProject(EditorController.Runtime); Task.Factory.StartNew(() => { if (open.LoadTask != null) { OperationProgressing progressing = null; Dispatcher.Invoke(new Action(() => { progressing = new OperationProgressing() { Owner = this }; })); Dispatcher.BeginInvoke(new Action(() => { progressing.ShowDialog(); })); open.LoadTask.Wait(); Dispatcher.BeginInvoke(new Action(() => { progressing.Close(); })); } EditProject(open.ProjectSession); }); }
public void OpenModelSystem() { OpenWindow openWindow = new OpenWindow() { Owner = this }; openWindow.OpenModelSystem(EditorController.Runtime); Task.Factory.StartNew(() => { if (openWindow.LoadTask != null) { OperationProgressing progressing = null; Dispatcher.Invoke(new Action(() => { progressing = new OperationProgressing() { Owner = this }; })); Dispatcher.BeginInvoke(new Action(() => { progressing.ShowDialog(); })); openWindow.LoadTask.Wait(); Dispatcher.BeginInvoke(new Action(() => { progressing.Close(); })); } var session = openWindow.ModelSystemSession; if (session != null) { Dispatcher.BeginInvoke(new Action(() => { EditModelSystem(session); SetStatusText("Ready"); })); } }); }
public void SelectModuleContent(ModelSystemStructureModel module) { Task.Run(() => { if (module != null) { var type = module.Type; var selectCorrectDocument = Task.Run(() => { UpdateSearch(false); Dispatcher.BeginInvoke(new Action(() => { var foundElement = SearchedItems.FirstOrDefault(element => element.Module == type); if (foundElement != null) { ResultBox.SelectedItem = foundElement; } })); }); OperationProgressing progressing = null; Dispatcher.Invoke(new Action(() => { progressing = new OperationProgressing() { Owner = MainWindow.Us }; })); Dispatcher.BeginInvoke(new Action(() => { progressing.ShowDialog(); })); selectCorrectDocument.Wait(); Dispatcher.BeginInvoke(new Action(() => { progressing.Close(); })); } }); }