Exemplo n.º 1
0
//		protected void OnTopMenuSelected(MenuCommand mc)
//		{
//
//
//			StatusBarService.SetMessage(mc.Description);
//		}
//
//		protected void OnTopMenuDeselected(MenuCommand mc)
//		{
//			SetStandardStatusBar(null, null);
//		}

        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            if (ProjectService.IsBuilding)
            {
                MessageService.ShowMessage(StringParser.Parse("${res:MainWindow.CannotCloseWithBuildInProgressMessage}"));
                e.Cancel = true;
                return;
            }

            ProjectService.SaveSolutionPreferences();

            while (WorkbenchSingleton.Workbench.WorkbenchWindowCollection.Count > 0)
            {
                IWorkbenchWindow window = WorkbenchSingleton.Workbench.WorkbenchWindowCollection[0];
                if (!window.CloseWindow(false))
                {
                    e.Cancel = true;
                    return;
                }
            }

            closeAll = true;

            ParserService.StopParserThread();

            layout.Detach();
            foreach (PadDescriptor padDescriptor in PadContentCollection)
            {
                padDescriptor.Dispose();
            }

            ProjectService.CloseSolution();
        }
Exemplo n.º 2
0
        protected override void OnClosing(CancelEventArgs e)
        {
            layout.Detach();

            while (WorkbenchSingleton.Workbench.ViewContentCollection.Count > 0)
            {
                IViewContent content = WorkbenchSingleton.Workbench.ViewContentCollection[0];
                if (content.WorkbenchWindow == null)
                {
                    LoggingService.Warn("Content with empty WorkbenchWindow found");
                    WorkbenchSingleton.Workbench.ViewContentCollection.RemoveAt(0);
                }
                else
                {
                    content.WorkbenchWindow.CloseWindow(false);
                    if (WorkbenchSingleton.Workbench.ViewContentCollection.IndexOf(content) >= 0)
                    {
                        e.Cancel = true;
                        return;
                    }
                }
            }

            foreach (PadDescriptor padDescriptor in PadContentCollection)
            {
                padDescriptor.Dispose();
            }

            if (FullScreen)
            {
                PropertyService.Set <bool>(_WindowIsFullScreen, true);
                if (_WindowState == FormWindowState.Maximized)
                {
                    PropertyService.Set <bool>(_WindowIsMaximized, true);
                }
                else
                {
                    PropertyService.Set <bool>(_WindowIsMaximized, false);
                }
            }
            else
            {
                PropertyService.Set <bool>(_WindowIsFullScreen, false);
                if (WindowState == FormWindowState.Maximized)
                {
                    PropertyService.Set <bool>(_WindowIsMaximized, true);
                }
                else
                {
                    PropertyService.Set <bool>(_WindowIsMaximized, false);
                    PropertyService.Set <Rectangle>(_BoundProperty, Bounds);
                }
            }

            base.OnClosing(e);
        }
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            layout.Detach();
            foreach (IPadContent content in PadContentCollection)
            {
                content.Dispose();
            }
        }
Exemplo n.º 4
0
//		protected void OnTopMenuSelected(MenuCommand mc)
//		{
//
//
//			StatusBarService.SetMessage(mc.Description);
//		}
//
//		protected void OnTopMenuDeselected(MenuCommand mc)
//		{
//			SetStandardStatusBar(null, null);
//		}

        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            ProjectService.SaveSolutionPreferences();

            while (WorkbenchSingleton.Workbench.ViewContentCollection.Count > 0)
            {
                IViewContent content = WorkbenchSingleton.Workbench.ViewContentCollection[0];
                if (content.WorkbenchWindow == null)
                {
                    LoggingService.Warn("Content with empty WorkbenchWindow found");
                    WorkbenchSingleton.Workbench.ViewContentCollection.RemoveAt(0);
                }
                else
                {
                    content.WorkbenchWindow.CloseWindow(false);
                    if (WorkbenchSingleton.Workbench.ViewContentCollection.IndexOf(content) >= 0)
                    {
                        e.Cancel = true;
                        return;
                    }
                }
            }

            closeAll = true;

            ParserService.StopParserThread();

            layout.Detach();
            foreach (PadDescriptor padDescriptor in PadContentCollection)
            {
                padDescriptor.Dispose();
            }

            ProjectService.CloseSolution();
        }
Exemplo n.º 5
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            while (WorkbenchSingleton.Workbench.WorkbenchWindowCollection.Count > 0)
            {
                IWorkbenchWindow window = WorkbenchSingleton.Workbench.WorkbenchWindowCollection[0];
                if (!window.CloseWindow(false))
                {
                    e.Cancel = true;
                    return;
                }
            }

            closeAll = true;

            ParserService.StopParserThread();

            layout.Detach();
            foreach (PadDescriptor padDescriptor in PadContentCollection)
            {
                padDescriptor.Dispose();
            }
        }