示例#1
0
        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);
            });
        }
示例#2
0
        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");
                    }));
                }
            });
        }
示例#3
0
 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();
             }));
         }
     });
 }
示例#4
0
 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();
            }));
        }
        });
 }