コード例 #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();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: RSchwoerer/Terminals
 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;
 }