Beispiel #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();
                    }));
                }

                var projectSession = open.ProjectSession;
                if(projectSession != null)
                {
                    Dispatcher.BeginInvoke(new Action(() =>
                    {
                        var display = new ProjectDisplay()
                        {
                            Session = projectSession,
                        };
                        display.InitiateModelSystemEditingSession += (editingSession) => EditModelSystem(editingSession);
                        var doc = AddNewWindow("Project - " + projectSession.Project.Name, display, () => { projectSession.Dispose(); });
                        doc.IsSelected = true;
                        display.RequestClose += (ignored) => doc.Close();
                        display.Focus();
                        SetStatusText("Ready");
                    }
                    ));
                }
            });
        }
Beispiel #2
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);
            });
        }