Esempio n. 1
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if(FullScreen) FullScreen = false;
            this.MainWindowNotifyIcon.Visible = false;

            if(tcTerminals.Items.Count > 0)
            {
                if(Settings.ShowConfirmDialog)
                {
                    SaveActiveConnectionsForm frmSaveActiveConnections = new SaveActiveConnectionsForm();
                    if(frmSaveActiveConnections.ShowDialog() == DialogResult.OK)
                    {
                        Settings.ShowConfirmDialog = !frmSaveActiveConnections.chkDontShowDialog.Checked;
                        if(frmSaveActiveConnections.chkOpenOnNextTime.Checked)
                        {
                            SaveActiveConnections();
                        }
                        e.Cancel = false;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
                else if(Settings.SaveConnectionsOnClose)
                {
                    SaveActiveConnections();
                }
            }
            SaveWindowState();
        }
Esempio n. 2
0
 private void SaveConnectonsIfRequested(FormClosingEventArgs args)
 {
 	Log.InsideMethod();
 	
     SaveActiveConnectionsForm frmSaveActiveConnections = new SaveActiveConnectionsForm();
     if (frmSaveActiveConnections.ShowDialog() == DialogResult.OK)
     {
         Settings.ShowConfirmDialog = frmSaveActiveConnections.PromptNextTime;
         if (frmSaveActiveConnections.OpenConnectionsNextTime)
             this.SaveActiveConnections();
     }
     else
         args.Cancel = true;
 }