MonthlyRecurrenceRule Class |
Namespace: Kettic.AspNet.Controls
The MonthlyRecurrenceRule type exposes the following members.
Name | Description | |
---|---|---|
MonthlyRecurrenceRule(Int32, Int32, RecurrenceRange) |
Initializes a new instance of the MonthlyRecurrenceRule class.
| |
MonthlyRecurrenceRule(Int32, RecurrenceDay, Int32, RecurrenceRange) |
Initializes a new instance of the MonthlyRecurrenceRule class.
|
Name | Description | |
---|---|---|
DayOfMonth |
Gets the day of month on which the event recurs.
| |
DayOrdinal |
Gets the day ordinal modifier. See DayOrdinal for additional information.
| |
Interval | Gets the interval (in months) between the occurrences. | |
Month |
Gets the month in which the event recurs.
|
using System; using Kettic.AspNet.Controls; namespace RecurrenceExamples { class MonthlyRecurrenceRuleExample1 { static void Main() { // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour. Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment"); // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment. RecurrenceRange range = new RecurrenceRange(); range.Start = recurringAppointment.Start; range.EventDuration = recurringAppointment.End - recurringAppointment.Start; range.MaxOccurrences = 5; // Creates a recurrence rule to repeat the appointment on the 5th day of every month. MonthlyRecurrenceRule rrule = new MonthlyRecurrenceRule(5, 1, range); Console.WriteLine("Appointment occurrs at the following times: "); int ix = 0; foreach (DateTime occurrence in rrule.Occurrences) { ix = ix + 1; Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime()); } } } } /* This example produces the following results: Appointment occurrs at the following times: 1: 6/5/2007 3:30:00 PM 2: 7/5/2007 3:30:00 PM 3: 8/5/2007 3:30:00 PM 4: 9/5/2007 3:30:00 PM 5: 10/5/2007 3:30:00 PM*/