private void SetSelectedItems(MatchRgbHexColor rgbHexColor) { var matchExpr = rgbHexColor.MatchExpression ?? _formattingDlg.GetDefaultMatchExpression(rgbHexColor.Expression); expressionTextBox.Text = matchExpr.RegExpr; matchComboBox.SelectedItem = GetSelectedItem(matchComboBox, matchExpr.matchOptions); foldChangeComboBox.SelectedItem = GetSelectedItem(foldChangeComboBox, matchExpr.matchOptions); pValueComboBox.SelectedItem = GetSelectedItem(pValueComboBox, matchExpr.matchOptions); }
public CreateMatchExpressionDlg(VolcanoPlotFormattingDlg formattingDlg, FoldChangeBindingSource.FoldChangeRow[] foldChangeRows, MatchRgbHexColor rgbHexColor) { InitializeComponent(); _formattingDlg = formattingDlg; _foldChangeRows = foldChangeRows; PopulateComboBoxes(); // The grid gets updated when any selected index changes or the expression textbox text changes // Only update manually after all selected items have been set _allowUpdateGrid = false; SetSelectedItems(rgbHexColor); _allowUpdateGrid = true; UpdateGrid(); }