예제 #1
0
        private void MainWindow_FormClosing(object Sender, FormClosingEventArgs EventArgs)
        {
            if (!bAllowClose && Settings.bKeepInTray)
            {
                Hide();
                EventArgs.Cancel = true;
            }
            else
            {
                for (int Idx = 0; Idx < TabControl.GetTabCount(); Idx++)
                {
                    WorkspaceControl Workspace = (WorkspaceControl)TabControl.GetTabData(Idx);
                    if (!Workspace.CanClose())
                    {
                        EventArgs.Cancel = true;
                        return;
                    }
                }

                ActivationListener.OnActivate -= OnActivationListenerAsyncCallback;
                ActivationListener.Stop();

                UpdateMonitor.OnUpdateAvailable -= OnUpdateAvailable;
                UpdateMonitor.Close();                 // prevent race condition

                StopScheduleTimer();

                Rectangle SaveBounds = (WindowState == FormWindowState.Normal)? Bounds : RestoreBounds;
                Settings.WindowRectangle = SaveBounds;
                Settings.bWindowVisible  = Visible;

                Settings.Save();
            }
        }
예제 #2
0
        bool TabControl_OnTabClosing(object TabData)
        {
            WorkspaceControl Workspace = (WorkspaceControl)TabData;

            return(Workspace.CanClose());
        }