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(); } }
public void ShowChangeSettings() { foreach (var form in FormUtil.OpenForms.OfType <EditGroupComparisonDlg>()) { if (ReferenceEquals(form.GroupComparisonModel, FoldChangeBindingSource.GroupComparisonModel)) { form.Activate(); return; } } var foldChangeSettings = new EditGroupComparisonDlg(FoldChangeBindingSource); foldChangeSettings.Show(this); }
public void AddGroupComparison() { using (var editDlg = new EditGroupComparisonDlg( DocumentContainer, GroupComparisonDef.EMPTY.ChangeSumTransitions(true), Settings.Default.GroupComparisonDefList)) { if (editDlg.ShowDialog(this) == DialogResult.OK) { var chosen = _groupComparisonsListBoxDriver.Chosen.ToList(); Settings.Default.GroupComparisonDefList.Add(editDlg.GroupComparisonDef); chosen.Add(editDlg.GroupComparisonDef); _groupComparisonsListBoxDriver.LoadList(chosen); } } }