/// <summary> /// When the user clicks the "Columns Settings", /// we display the suggestions window and save the changes. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void columnSettingsMenuItem_Click(object sender, EventArgs e) { // Update the settings from the current columns using (PlanColumnSelectWindow dialog = new PlanColumnSelectWindow(ExportColumnSettings())) { if (dialog.ShowDialog() != DialogResult.OK) return; ImportColumnSettings(dialog.Columns.Cast<PlanColumnSettings>()); Settings.UI.PlanWindow.Columns.Clear(); Settings.UI.PlanWindow.Columns.AddRange(ExportColumnSettings()); } }
/// <summary> /// When the user clicks the "select columns" button, /// we display the suggestions window and save the changes. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void tsbSelectColumns_Click(object sender, EventArgs e) { // Update the settings from the current columns var columns = ExportColumnSettings(); using (var dialog = new PlanColumnSelectWindow(columns)) { if (dialog.ShowDialog() == DialogResult.OK) { ImportColumnSettings(dialog.Columns.Cast<PlanColumnSettings>()); Settings.UI.PlanWindow.Columns = ExportColumnSettings().ToArray(); } } }