Esempio n. 1
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (isChanged)
     {
         CustomFilterOptionSettings customFilterOptionSettings = config.LoadCustomFilterOptionSettings();
         if (customFilterOptionSettings != null)
         {
             customFilterOptionSettings.ShowWCFTraces           = chkShowWCFTraces.Checked;
             customFilterOptionSettings.ShowMessageSentReceived = chkMessageSentReceived.Checked;
             customFilterOptionSettings.ShowTransfer            = chkTransfer.Checked;
             customFilterOptionSettings.ShowSecurityMessage     = chkShowSMs.Checked;
             customFilterOptionSettings.ShowReliableMessage     = chkShowRMs.Checked;
             customFilterOptionSettings.ShowTransactionMessage  = chkShowTMs.Checked;
             if (!config.UpdateConfigFile())
             {
                 return;
             }
             if (promptUser)
             {
                 if (MessageBox.Show(this, SR.GetString("FO_MSG1"), SR.GetString("FO_Title"), MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0) == DialogResult.Yes)
                 {
                     base.DialogResult = DialogResult.Yes;
                 }
                 else
                 {
                     base.DialogResult = DialogResult.No;
                 }
             }
         }
     }
     Close();
 }
Esempio n. 2
0
        public void Initialize(AppConfigManager config, bool promptUser)
        {
            this.config     = config;
            this.promptUser = promptUser;
            CustomFilterOptionSettings customFilterOptionSettings = config.LoadCustomFilterOptionSettings();

            if (customFilterOptionSettings != null)
            {
                if (customFilterOptionSettings.ShowWCFTraces)
                {
                    chkShowWCFTraces.Checked = true;
                }
                if (customFilterOptionSettings.ShowTransfer)
                {
                    chkTransfer.Checked = true;
                }
                if (customFilterOptionSettings.ShowMessageSentReceived)
                {
                    chkMessageSentReceived.Checked = true;
                }
                if (customFilterOptionSettings.ShowSecurityMessage)
                {
                    chkShowSMs.Checked = true;
                }
                if (customFilterOptionSettings.ShowReliableMessage)
                {
                    chkShowRMs.Checked = true;
                }
                if (customFilterOptionSettings.ShowTransactionMessage)
                {
                    chkShowTMs.Checked = true;
                }
                UpdateEnabledStatusForWCFOptions(chkShowWCFTraces.Checked);
            }
            isInitializing = false;
        }