Пример #1
0
        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult result = DialogResult.OK;

            if (Properties.Settings.Default.warnOnClose && ListThreads.Count > 0)
            {
                CloseWarn clw = new CloseWarn();
                result   = clw.ShowDialog();
                e.Cancel = (result == DialogResult.Cancel);
            }

            if (result == DialogResult.OK)
            {
                nfTray.Visible = false;
                nfTray.Dispose();
                scnTimer.Enabled = false;

                if (Properties.Settings.Default.saveOnClose)
                {
                    General.WriteURLs(ListBoards, ListThreads);
                }
            }
        }
Пример #2
0
        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            bool close = true;

            if (General.warnOnClose && clThreads.Count > 0)
            {
                CloseWarn clw    = new CloseWarn();
                var       result = clw.ShowDialog();
                close = clw.closeit;
                if (!close)
                {
                    e.Cancel = true;
                }
            }

            if (close == true || !General.warnOnClose)
            {
                this.Hide();
                nfTray.Visible = false;
                if (General.saveOnClose)
                {
                    General.writeURLs(clBoards, clThreads);
                }

                if (Scanner != null && Scanner.IsAlive)
                {
                    Scanner.Abort();
                }
                for (int i = 0; i < thrThreads.Count; i++)
                {
                    if (thrThreads[i].IsAlive)
                    {
                        thrThreads[i].Abort();
                    }
                }
            }
        }