Ejemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            this.okButton.Enabled    = false;
            this.applyButton.Enabled = false;

            if (this.regexCheckBox.Checked &&
                !FilterHelper.CheckForFilterTextComboBoxErrors(this, new ComboBox[] { callIdFilterComboBox, finalStateFilterComboBox, recordNameFilterComboBox, recordValueFilterComboBox }))
            {
                return;
            }

            Filter.CallId      = callIdFilterComboBox.Text;
            Filter.FinalState  = finalStateFilterComboBox.Text;
            Filter.RecordName  = recordNameFilterComboBox.Text;
            Filter.RecordValue = recordValueFilterComboBox.Text;

            Filter.TimeInAfterActive  = timeInFilterAfterEnabledCheckBox.Checked;
            Filter.TimeInAfter        = timeInAfterDateTimePicker.Value;
            Filter.TimeInBeforeActive = timeInFilterBeforeEnabledCheckBox.Checked;
            Filter.TimeInBefore       = timeInBeforeDateTimePicker.Value;
            Filter.TimeInEmpty        = timeInEmptyCheckBox.Checked;

            Filter.FinalStateTimeAfterActive  = finalStateTimeFilterAfterEnabledCheckBox.Checked;
            Filter.FinalStateTimeAfter        = finalStateTimeAfterDateTimePicker.Value;
            Filter.FinalStateTimeBeforeActive = finalStateTimeFilterBeforeEnabledCheckBox.Checked;
            Filter.FinalStateTimeBefore       = finalStateTimeBeforeDateTimePicker.Value;
            Filter.FinalStateTimeEmpty        = finalStateTimeEmptyCheckBox.Checked;

            Filter.CallbackAttemptsMinActive = callbackAttemptsMinEnabledCheckBox.Checked;
            Filter.CallbackAttemptsMin       = (int)callbackAttemptsMinNumericUpDown.Value;

            Filter.CallbackAttemptsMaxActive = callbackAttemptsMaxEnabledCheckBox.Checked;
            Filter.CallbackAttemptsMax       = (int)callbackAttemptsMaxNumericUpDown.Value;

            this.Filter.UseRegex      = this.regexCheckBox.Checked;
            this.Filter.CaseSensitive = this.caseSensitiveCheckBox.Checked;

            FilterHelper.UpdateDropDownWithFilterText(callIdFilterComboBox);
            FilterHelper.UpdateDropDownWithFilterText(finalStateFilterComboBox);
            FilterHelper.UpdateDropDownWithFilterText(recordNameFilterComboBox);
            FilterHelper.UpdateDropDownWithFilterText(recordValueFilterComboBox);

            if (FilterUpdated != null)
            {
                FilterUpdated(this, EventArgs.Empty);
            }

            if (sender == this.okButton)
            {
                this.Hide();
            }
        }
        private void okButton_Clicked(object sender, EventArgs e)
        {
            this.okButton.Enabled    = false;
            this.applyButton.Enabled = false;

            if (this.regexCheckBox.Checked &&
                !FilterHelper.CheckForFilterTextComboBoxErrors(this, new ComboBox[] { recordNameFilterComboBox,
                                                                                      recordValueFilterComboBox }))
            {
                return;
            }

            Filter.RecordName  = recordNameFilterComboBox.Text;
            Filter.RecordValue = recordValueFilterComboBox.Text;

            Filter.TimeAfterActive  = timestampFilterAfterEnabledCheckBox.Checked;
            Filter.TimeBeforeActive = timestampFilterBeforeEnabledCheckBox.Checked;

            Filter.TimeAfter  = timestampAfterDateTimePicker.Value;
            Filter.TimeBefore = timestampBeforeDateTimePicker.Value;

            Filter.UseRegex      = regexCheckBox.Checked;
            Filter.CaseSensitive = caseSensitiveCheckBox.Checked;

            FilterHelper.UpdateDropDownWithFilterText(recordNameFilterComboBox);
            FilterHelper.UpdateDropDownWithFilterText(recordValueFilterComboBox);

            if (FilterUpdated != null)
            {
                FilterUpdated(this, EventArgs.Empty);
            }

            if (sender == this.okButton)
            {
                this.Hide();
            }
        }