/// <summary> /// Initializes a new instance of the <see cref="YearlyRecurrenceRule"/> class. /// </summary> /// <example> /// <code lang="CS"> /// using System; /// using Micajah.Common.Bll.RecurringSchedule; /// /// namespace RecurrenceExamples /// { /// class YearlyRecurrenceRuleExample2 /// { /// static void Main() /// { /// // Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour. /// Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"), /// Convert.ToDateTime("4/1/2007 10:30 AM"), "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 second monday of April each year. /// YearlyRecurrenceRule rrule = new YearlyRecurrenceRule(2, RecurrenceMonth.April, RecurrenceDay.Monday, 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: 4/9/2007 10:00:00 AM /// 2: 4/14/2008 10:00:00 AM /// 3: 4/13/2009 10:00:00 AM /// 4: 4/12/2010 10:00:00 AM /// 5: 4/11/2011 10:00:00 AM /// */ /// </code> /// <code lang="VB"> /// Imports System /// Imports Micajah.Common.Bll.RecurringSchedule /// /// Namespace RecurrenceExamples /// Class YearlyRecurrenceRuleExample2 /// Shared Sub Main() /// ' Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour. /// Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"), Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment") /// /// ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment. /// Dim range As 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 second monday of April each year. /// Dim rrule As New YearlyRecurrenceRule(2, RecurrenceMonth.April, RecurrenceDay.Monday, range) /// /// Console.WriteLine("Appointment occurrs at the following times: ") /// Dim ix As Integer = 0 /// For Each occurrence As DateTime In rrule.Occurrences /// ix = ix + 1 /// Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime()) /// Next /// End Sub /// End Class /// End Namespace /// /// ' /// 'This example produces the following results: /// ' /// 'Appointment occurrs at the following times: /// ' 1: 4/9/2007 10:00:00 AM /// ' 2: 4/14/2008 10:00:00 AM /// ' 3: 4/13/2009 10:00:00 AM /// ' 4: 4/12/2010 10:00:00 AM /// ' 5: 4/11/2011 10:00:00 AM /// ' /// </code> /// </example> /// <param name="dayOrdinal">The day ordinal modifier. See <see cref="RecurrencePattern.DayOrdinal"/> for additional information.</param> /// <param name="month">The month in which the event recurs.</param> /// <param name="daysOfWeekMask">A bit mask that specifies the week days on which the event recurs.</param> /// <param name="range">The <see cref="RecurrenceRange"/> instance that specifies the range of this rule.</param> public YearlyRecurrenceRule(int dayOrdinal, RecurrenceMonth month, RecurrenceDay daysOfWeekMask, RecurrenceRange range) : this(month, -1, dayOrdinal, daysOfWeekMask, range) { }
private YearlyRecurrenceRule(RecurrenceMonth month, int dayOfMonth, int dayOrdinal, RecurrenceDay daysOfWeekMask, RecurrenceRange range) { rulePattern.Frequency = RecurrenceFrequency.Yearly; rulePattern.Interval = 1; rulePattern.DaysOfWeekMask = daysOfWeekMask; rulePattern.DayOfMonth = dayOfMonth; rulePattern.DayOrdinal = dayOrdinal; rulePattern.Month = month; ruleRange = range; }
private MonthlyRecurrenceRule(int dayOfMonth, int interval, int dayOrdinal, RecurrenceDay daysOfWeekMask, RecurrenceRange range) { rulePattern.Frequency = RecurrenceFrequency.Monthly; rulePattern.Interval = interval; rulePattern.DaysOfWeekMask = daysOfWeekMask; rulePattern.DayOfMonth = dayOfMonth; rulePattern.DayOrdinal = dayOrdinal; rulePattern.Month = RecurrenceMonth.None; ruleRange = range; }
/// <summary> /// Initializes a new instance of the <see cref="YearlyRecurrenceRule"/> class. /// </summary> /// <example> /// <code lang="CS"> /// using System; /// using Micajah.Common.Bll.RecurringSchedule; /// /// namespace RecurrenceExamples /// { /// class YearlyRecurrenceRuleExample1 /// { /// static void Main() /// { /// // Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour. /// Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"), /// Convert.ToDateTime("4/1/2007 10:30 AM"), "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 1th of April each year. /// YearlyRecurrenceRule rrule = new YearlyRecurrenceRule(RecurrenceMonth.April, 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: 4/1/2007 10:00:00 AM /// 2: 4/1/2008 10:00:00 AM /// 3: 4/1/2009 10:00:00 AM /// 4: 4/1/2010 10:00:00 AM /// 5: 4/1/2011 10:00:00 AM /// */ /// </code> /// <code lang="VB"> /// Imports System /// Imports Micajah.Common.Bll.RecurringSchedule /// /// Namespace RecurrenceExamples /// Class YearlyRecurrenceRuleExample1 /// Shared Sub Main() /// ' Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour. /// Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"), Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment") /// /// ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment. /// Dim range As 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 1th of April each year. /// Dim rrule As New YearlyRecurrenceRule(RecurrenceMonth.April, 1, range) /// /// Console.WriteLine("Appointment occurrs at the following times: ") /// Dim ix As Integer = 0 /// For Each occurrence As DateTime In rrule.Occurrences /// ix = ix + 1 /// Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime()) /// Next /// End Sub /// End Class /// End Namespace /// /// ' /// 'This example produces the following results: /// ' /// 'Appointment occurrs at the following times: /// ' 1: 4/1/2007 10:00:00 AM /// ' 2: 4/1/2008 10:00:00 AM /// ' 3: 4/1/2009 10:00:00 AM /// ' 4: 4/1/2010 10:00:00 AM /// ' 5: 4/1/2011 10:00:00 AM /// ' /// </code> /// </example> /// <param name="month">The month in which the event recurs.</param> /// <param name="dayOfMonth">The day of month on which the event recurs.</param> /// <param name="range">The <see cref="RecurrenceRange"/> instance that specifies the range of this rule.</param> public YearlyRecurrenceRule(RecurrenceMonth month, int dayOfMonth, RecurrenceRange range) : this(month, dayOfMonth, 0, RecurrenceDay.EveryDay, range) { }
/// <summary> /// Initializes a new instance of the <see cref="MonthlyRecurrenceRule"/> class. /// </summary> /// <example> /// <code lang="CS"> /// using System; /// using Micajah.Common.Bll.RecurringSchedule; /// /// namespace RecurrenceExamples /// { /// class MonthlyRecurrenceRuleExample2 /// { /// 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 last monday of every two months. /// MonthlyRecurrenceRule rrule = new MonthlyRecurrenceRule(-1, RecurrenceDay.Monday, 2, 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/25/2007 3:30:00 PM /// 2: 8/27/2007 3:30:00 PM /// 3: 10/29/2007 2:30:00 PM /// 4: 12/31/2007 2:30:00 PM /// 5: 2/25/2008 2:30:00 PM /// */ /// </code> /// <code lang="VB"> /// Imports System /// Imports Micajah.Common.Bll.RecurringSchedule /// /// Namespace RecurrenceExamples /// Class MonthlyRecurrenceRuleExample2 /// Shared Sub Main() /// ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour. /// Dim recurringAppointment As 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. /// Dim range As 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 last monday of every two months. /// Dim rrule As New MonthlyRecurrenceRule(-1, RecurrenceDay.Monday, 2, range) /// /// Console.WriteLine("Appointment occurrs at the following times: ") /// Dim ix As Integer = 0 /// For Each occurrence As DateTime In rrule.Occurrences /// ix = ix + 1 /// Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime()) /// Next /// End Sub /// End Class /// End Namespace /// /// ' /// 'This example produces the following results: /// ' /// 'Appointment occurrs at the following times: /// ' 1: 6/25/2007 3:30:00 PM /// ' 2: 8/27/2007 3:30:00 PM /// ' 3: 10/29/2007 2:30:00 PM /// ' 4: 12/31/2007 2:30:00 PM /// ' 5: 2/25/2008 2:30:00 PM /// ' /// </code> /// </example> /// <param name="dayOrdinal">The day ordinal modifier. See <see cref="RecurrencePattern.DayOrdinal"/> for additional information.</param> /// <param name="daysOfWeekMask">A bit mask that specifies the week days on which the event recurs.</param> /// <param name="interval">The interval (in months) between the occurrences.</param> /// <param name="range">The <see cref="RecurrenceRange"/> instance that specifies the range of this rule.</param> public MonthlyRecurrenceRule(int dayOrdinal, RecurrenceDay daysOfWeekMask, int interval, RecurrenceRange range) : this(0, interval, dayOrdinal, daysOfWeekMask, range) { }
/// <summary> /// Initializes a new instance of the <see cref="MonthlyRecurrenceRule"/> class. /// </summary> /// <example> /// <code lang="CS"> /// using System; /// using Micajah.Common.Bll.RecurringSchedule; /// /// 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 /// */ /// </code> /// <code lang="VB"> /// Imports System /// Imports Micajah.Common.Bll.RecurringSchedule /// /// Namespace RecurrenceExamples /// Class MonthlyRecurrenceRuleExample1 /// Shared Sub Main() /// ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour. /// Dim recurringAppointment As 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. /// Dim range As 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. /// Dim rrule As New MonthlyRecurrenceRule(5, 1, range) /// /// Console.WriteLine("Appointment occurrs at the following times: ") /// Dim ix As Integer = 0 /// For Each occurrence As DateTime In rrule.Occurrences /// ix = ix + 1 /// Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime()) /// Next /// End Sub /// End Class /// End Namespace /// /// ' /// '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 /// ' /// </code> /// </example> /// <param name="dayOfMonth">The day of month on which the event recurs.</param> /// <param name="interval">The interval (in months) between the occurrences.</param> /// <param name="range">The <see cref="RecurrenceRange"/> instance that specifies the range of this rule.</param> public MonthlyRecurrenceRule(int dayOfMonth, int interval, RecurrenceRange range) : this(dayOfMonth, interval, 0, RecurrenceDay.None, range) { }
/// <example> /// <code lang="CS"> /// using System; /// using Micajah.Common.Bll.RecurringSchedule; /// /// namespace RecurrenceExamples /// { /// class DailyRecurrenceRuleExample2 /// { /// 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 = 10; /// /// // Creates a recurrence rule to repeat the appointment every week day. /// DailyRecurrenceRule rrule = new DailyRecurrenceRule(RecurrenceDay.WeekDays, 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} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek); /// } /// } /// } /// } /// /// /* /// This example produces the following results: /// /// Appointment occurrs at the following times: /// 1: 6/1/2007 3:30:00 PM (Friday) /// 2: 6/4/2007 3:30:00 PM (Monday) /// 3: 6/5/2007 3:30:00 PM (Tuesday) /// 4: 6/6/2007 3:30:00 PM (Wednesday) /// 5: 6/7/2007 3:30:00 PM (Thursday) /// 6: 6/8/2007 3:30:00 PM (Friday) /// 7: 6/11/2007 3:30:00 PM (Monday) /// 8: 6/12/2007 3:30:00 PM (Tuesday) /// 9: 6/13/2007 3:30:00 PM (Wednesday) /// 10: 6/14/2007 3:30:00 PM (Thursday) /// */ /// </code> /// <code lang="VB"> /// Imports System /// Imports Micajah.Common.Bll.RecurringSchedule /// /// Namespace RecurrenceExamples /// Class DailyRecurrenceRuleExample2 /// Shared Sub Main() /// ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour. /// Dim recurringAppointment As 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. /// Dim range As New RecurrenceRange() /// range.Start = recurringAppointment.Start /// range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start /// range.MaxOccurrences = 10 /// /// ' Creates a recurrence rule to repeat the appointment every week day. /// Dim rrule As New DailyRecurrenceRule(RecurrenceDay.WeekDays, range) /// /// Console.WriteLine("Appointment occurrs at the following times: ") /// Dim ix As Integer = 0 /// For Each occurrence As DateTime In rrule.Occurrences /// ix = ix + 1 /// Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek) /// Next /// End Sub /// End Class /// End Namespace /// /// ' /// 'This example produces the following results: /// ' /// 'Appointment occurrs at the following times: /// ' 1: 6/1/2007 3:30:00 PM (Friday) /// ' 2: 6/4/2007 3:30:00 PM (Monday) /// ' 3: 6/5/2007 3:30:00 PM (Tuesday) /// ' 4: 6/6/2007 3:30:00 PM (Wednesday) /// ' 5: 6/7/2007 3:30:00 PM (Thursday) /// ' 6: 6/8/2007 3:30:00 PM (Friday) /// ' 7: 6/11/2007 3:30:00 PM (Monday) /// ' 8: 6/12/2007 3:30:00 PM (Tuesday) /// ' 9: 6/13/2007 3:30:00 PM (Wednesday) /// '10: 6/14/2007 3:30:00 PM (Thursday) /// ' /// </code> /// </example> /// <summary> /// Initializes a new instance of <see cref="DailyRecurrenceRule"/> with the /// specified days of week bit mask and <see cref="RecurrenceRange"/>. /// </summary> /// <param name="daysOfWeekMask">A bit mask that specifies the week days on which the event recurs.</param> /// <param name="range"> /// The <see cref="RecurrenceRange"/> instance that specifies the range of this /// recurrence rule. /// </param> public DailyRecurrenceRule(RecurrenceDay daysOfWeekMask, RecurrenceRange range) : this(1, daysOfWeekMask, range) { }
/// <example> /// <code lang="CS"> /// using System; /// using Micajah.Common.Bll.RecurringSchedule; /// /// namespace RecurrenceExamples /// { /// class DailyRecurrenceRuleExample1 /// { /// 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 = 10; /// /// // Creates a recurrence rule to repeat the appointment every two days. /// DailyRecurrenceRule rrule = new DailyRecurrenceRule(2, 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} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek); /// } /// } /// } /// } /// /// /* /// This example produces the following results: /// /// Appointment occurrs at the following times: /// 1: 6/1/2007 3:30:00 PM (Friday) /// 2: 6/3/2007 3:30:00 PM (Sunday) /// 3: 6/5/2007 3:30:00 PM (Tuesday) /// 4: 6/7/2007 3:30:00 PM (Thursday) /// 5: 6/9/2007 3:30:00 PM (Saturday) /// 6: 6/11/2007 3:30:00 PM (Monday) /// 7: 6/13/2007 3:30:00 PM (Wednesday) /// 8: 6/15/2007 3:30:00 PM (Friday) /// 9: 6/17/2007 3:30:00 PM (Sunday) /// 10: 6/19/2007 3:30:00 PM (Tuesday) /// */ /// </code> /// <code lang="VB"> /// Imports System /// Imports Micajah.Common.Bll.RecurringSchedule /// /// Namespace RecurrenceExamples /// Class DailyRecurrenceRuleExample1 /// Shared Sub Main() /// ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour. /// Dim recurringAppointment As 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. /// Dim range As New RecurrenceRange() /// range.Start = recurringAppointment.Start /// range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start /// range.MaxOccurrences = 10 /// /// ' Creates a recurrence rule to repeat the appointment every two days. /// Dim rrule As New DailyRecurrenceRule(2, range) /// /// Console.WriteLine("Appointment occurrs at the following times: ") /// Dim ix As Integer = 0 /// For Each occurrence As DateTime In rrule.Occurrences /// ix = ix + 1 /// Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek) /// Next /// End Sub /// End Class /// End Namespace /// /// ' /// 'This example produces the following results: /// ' /// 'Appointment occurrs at the following times: /// ' 1: 6/1/2007 3:30:00 PM (Friday) /// ' 2: 6/3/2007 3:30:00 PM (Sunday) /// ' 3: 6/5/2007 3:30:00 PM (Tuesday) /// ' 4: 6/7/2007 3:30:00 PM (Thursday) /// ' 5: 6/9/2007 3:30:00 PM (Saturday) /// ' 6: 6/11/2007 3:30:00 PM (Monday) /// ' 7: 6/13/2007 3:30:00 PM (Wednesday) /// ' 8: 6/15/2007 3:30:00 PM (Friday) /// ' 9: 6/17/2007 3:30:00 PM (Sunday) /// '10: 6/19/2007 3:30:00 PM (Tuesday) /// ' /// </code> /// </example> /// <summary> /// Initializes a new instance of <see cref="DailyRecurrenceRule"/> with the /// specified interval (in days) and <see cref="RecurrenceRange"/>. /// </summary> /// <param name="interval">The number of days between the occurrences.</param> /// <param name="range"> /// The <see cref="RecurrenceRange"/> instance that specifies the range of this /// recurrence rule. /// </param> public DailyRecurrenceRule(int interval, RecurrenceRange range) : this(interval, RecurrenceDay.EveryDay, range) { }
/// <summary> /// Initializes a new instance of <see cref="WeeklyRecurrenceRule"/> with the /// specified interval, days of week bit mask and <see cref="RecurrenceRange"/>. /// </summary> /// <param name="interval">The number of weeks between the occurrences.</param> /// <param name="daysOfWeekMask">A bit mask that specifies the week days on which the event recurs.</param> /// <param name="range"> /// The <see cref="RecurrenceRange"/> instance that specifies the range of this rule. /// </param> /// <param name="firstDayOfWeek"> /// The first day of week to use for calculations. /// </param> public WeeklyRecurrenceRule(int interval, RecurrenceDay daysOfWeekMask, RecurrenceRange range, DayOfWeek firstDayOfWeek) : this(interval, daysOfWeekMask, range) { Pattern.FirstDayOfWeek = firstDayOfWeek; }