/// <summary> /// Creates the dialog based upon a plan. /// </summary> /// <param name="plan">Plan to display obsolete entries from</param> /// <returns>Action to be taken</returns> public static ObsoleteEntriesAction ShowDialog(Plan plan) { if (plan == null) return ObsoleteEntriesAction.None; if (!plan.ContainsObsoleteEntries) return ObsoleteEntriesAction.None; ObsoleteEntriesForm form = new ObsoleteEntriesForm(plan); return form.ShowObsoleteEntriesDialog(); }
/// <summary> /// Creates the dialog based upon a plan. /// </summary> /// <param name="plan">Plan to display obsolete entries from</param> /// <returns>Action to be taken</returns> public static ObsoleteEntriesAction ShowDialog(Plan plan) { if (plan == null) { return(ObsoleteEntriesAction.None); } if (!plan.ContainsObsoleteEntries) { return(ObsoleteEntriesAction.None); } ObsoleteEntriesForm form = new ObsoleteEntriesForm(plan); return(form.ShowObsoleteEntriesDialog()); }
/// <summary> /// Status bar > Obsolete entries label. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void obsoleteEntriesToolStripStatusLabel_Click(object sender, EventArgs e) { ObsoleteEntriesAction action = ObsoleteEntriesForm.ShowDialog(m_plan); switch (action) { case ObsoleteEntriesAction.RemoveAll: planEditor.ClearObsoleteEntries(ObsoleteRemovalPolicy.RemoveAll); ObsoleteEntriesStatusLabel.Visible = false; break; case ObsoleteEntriesAction.RemoveConfirmed: planEditor.ClearObsoleteEntries(ObsoleteRemovalPolicy.ConfirmedOnly); ObsoleteEntriesStatusLabel.Visible = false; break; case ObsoleteEntriesAction.KeepAll: case ObsoleteEntriesAction.None: default: break; } }