Exemple #1
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (ParentForm != null)
     {
         ParentForm.FormClosing +=
             delegate(object sender, FormClosingEventArgs e2)
         {
             if (ParentForm.DialogResult == DialogResult.OK)
             {
                 if (!isUnix && useCygwinSocketCheckBox.Checked &&
                     string.IsNullOrWhiteSpace(cygwinSocketPathTextBox.Text))
                 {
                     MessageService.ShowWarning("Must specify path for Cygwin socket file.");
                     e2.Cancel = true;
                     return;
                 }
                 if (!isUnix && useMsysSocketCheckBox.Checked &&
                     string.IsNullOrWhiteSpace(msysSocketPathTextBox.Text))
                 {
                     MessageService.ShowWarning("Must specify path for MSYS socket file.");
                     e2.Cancel = true;
                     return;
                 }
                 if (isUnix && modeComboBox.Text != Translatable.OptionAgentModeClient &&
                     string.IsNullOrWhiteSpace(cygwinSocketPathTextBox.Text))
                 {
                     MessageService.ShowWarning("Must specify path for Agent socket file.");
                     e2.Cancel = true;
                     return;
                 }
                 SaveChanges();
                 if (ext.Options.UseCygwinSocket)
                 {
                     ext.StartCygwinSocket();
                 }
                 else
                 {
                     ext.StopCygwinSocket();
                 }
                 if (ext.Options.UseMsysSocket)
                 {
                     ext.StartMsysSocket();
                 }
                 else
                 {
                     ext.StopMsysSocket();
                 }
                 if (isUnix)
                 {
                     ext.StartUnixSocket();
                 }
             }
             optionsList.Release();
         };
     }
 }
Exemple #2
0
        private void CleanUpEx()
        {
            int nTab = m_tabMain.SelectedIndex;

            if ((nTab >= 0) && (nTab < m_tabMain.TabPages.Count))
            {
                Program.Config.Defaults.OptionsTabIndex = (uint)nTab;
            }

            m_cdxSecurityOptions.Release();
            m_cdxPolicy.Release();
            m_cdxGuiOptions.Release();
            m_cdxAdvanced.Release();

            AppConfigEx.ClearXmlPathCache();
        }
        private void CleanUpEx()
        {
            int nTab = m_tabMain.SelectedIndex;

            if ((nTab >= 0) && (nTab < m_tabMain.TabPages.Count))
            {
                Program.Config.Defaults.OptionsTabIndex = (uint)nTab;
            }

            m_tabMain.ImageList = null;             // Detach event handlers

            UIUtil.DisposeButtonImage(m_btnCustomAltColor, ref m_imgAltItemBg);

            m_cdxSecurityOptions.Release();
            m_cdxPolicy.Release();
            m_cdxGuiOptions.Release();
            m_cdxAdvanced.Release();

            AppConfigEx.ClearXmlPathCache();
        }