Exemplo n.º 1
0
        public void ShowFormattingDialog()
        {
            var foldChangeRows = _bindingListSource.OfType <RowItem>()
                                 .Select(rowItem => rowItem.Value)
                                 .OfType <FoldChangeBindingSource.FoldChangeRow>()
                                 .ToArray();

            var backup = GroupComparisonDef.ColorRows.Select(r => (MatchRgbHexColor)r.Clone()).ToArray();
            // This list will later be used as a BindingList, so we have to create a mutable clone
            var copy = GroupComparisonDef.ColorRows.Select(r => (MatchRgbHexColor)r.Clone()).ToList();

            using (var form = new VolcanoPlotFormattingDlg(this, copy, foldChangeRows,
                                                           rows =>
            {
                EditGroupComparisonDlg.ChangeGroupComparisonDef(false, GroupComparisonModel, GroupComparisonDef.ChangeColorRows(rows));
                UpdateGraph();
            }))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    EditGroupComparisonDlg.ChangeGroupComparisonDef(true, GroupComparisonModel, GroupComparisonDef);
                }
                else
                {
                    EditGroupComparisonDlg.ChangeGroupComparisonDef(false, GroupComparisonModel, GroupComparisonDef.ChangeColorRows(backup));
                }

                UpdateGraph();
            }
        }
Exemplo n.º 2
0
        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();
        }