Click or drag to resize
MonthlyRecurrenceRule Constructor (Int32, RecurrenceDay, Int32, RecurrenceRange)
Initializes a new instance of the MonthlyRecurrenceRule class.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public MonthlyRecurrenceRule(
	int dayOrdinal,
	RecurrenceDay daysOfWeekMask,
	int interval,
	RecurrenceRange range
)

Parameters

dayOrdinal
Type: SystemInt32
The day ordinal modifier. See DayOrdinal for additional information.
daysOfWeekMask
Type: Kettic.AspNet.ControlsRecurrenceDay
A bit mask that specifies the week days on which the event recurs.
interval
Type: SystemInt32
The interval (in months) between the occurrences.
range
Type: Kettic.AspNet.ControlsRecurrenceRange
The RecurrenceRange instance that specifies the range of this rule.
Examples
using System;
using Kettic.AspNet.Controls;

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*/
See Also