コード例 #1
0
ファイル: MainWindow.cs プロジェクト: nikimar1/cloneofg4g2019
        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++)
                {
                    IMainWindowTabPanel TabPanel = (IMainWindowTabPanel)TabControl.GetTabData(Idx);
                    if (!TabPanel.CanClose())
                    {
                        EventArgs.Cancel = true;
                        return;
                    }
                }

                StopScheduleTimer();
            }

            Settings.bWindowVisible = Visible;
            Settings.WindowState    = WindowState;
            if (WindowState == FormWindowState.Normal)
            {
                Settings.WindowBounds = new Rectangle(Location, Size);
            }
            else
            {
                Settings.WindowBounds = RestoreBounds;
            }

            Settings.Save();
        }
コード例 #2
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++)
                {
                    IMainWindowTabPanel TabPanel = (IMainWindowTabPanel)TabControl.GetTabData(Idx);
                    if (!TabPanel.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();
            }
        }
コード例 #3
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++)
                {
                    IMainWindowTabPanel TabPanel = (IMainWindowTabPanel)TabControl.GetTabData(Idx);
                    if (!TabPanel.CanClose())
                    {
                        EventArgs.Cancel = true;
                        return;
                    }
                }

                StopScheduleTimer();

                Settings.bWindowVisible = Visible;
                Settings.Save();
            }
        }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: nikimar1/cloneofg4g2019
        bool TabControl_OnTabClosing(object TabData)
        {
            IMainWindowTabPanel TabPanel = (IMainWindowTabPanel)TabData;

            return(TabPanel.CanClose());
        }