//===================================================================== /// <summary> /// Add a recurrence rule /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event parameters</param> private void btnAddRRule_Click(object sender, EventArgs e) { using (RecurrencePropertiesDlg dlg = new RecurrencePropertiesDlg()) { if (dlg.ShowDialog() == DialogResult.OK) { // Add the recurrence rule to the collection and the list box using the appropriate type if (!editsExceptions) { RRuleProperty rr = new RRuleProperty(); dlg.GetRecurrence(rr.Recurrence); rRules.Add(rr); lbRRules.Items.Add(rr.Recurrence.ToString()); } else { ExRuleProperty er = new ExRuleProperty(); dlg.GetRecurrence(er.Recurrence); rRules.Add(er); lbRRules.Items.Add(er.Recurrence.ToString()); } } } this.SetButtonStates(); }