Click or drag to resize
RecurrencePattern Class
Specifies the pattern that RecurrenceRule uses to evaluate the recurrence dates set.
Inheritance Hierarchy

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
public class RecurrencePattern : IEquatable<RecurrencePattern>

The RecurrencePattern type exposes the following members.

Public methodRecurrencePattern
Public methodEquals(Object)
Overloaded. Overridden. Returns a value indicating whether this instance is equal to a specified object.
(Overrides ObjectEquals(Object).)
Public methodEquals(RecurrencePattern)
Overloaded. Overridden. Returns a value indicating whether this instance is equal to a specified RecurrencePattern object.
Public methodGetHashCode
Overriden. Returns the hash code for this instance.
(Overrides ObjectGetHashCode.)
Public operatorStatic memberEquality
Determines whether two specified RecurrencePattern objects have the same value.
Public operatorStatic memberInequality
Determines whether two specified RecurrencePattern objects have different values.
Public propertyDayOfMonth
Gets or sets the day month on which the event recurs.
Public propertyDayOrdinal
Public propertyDaysOfWeekMask
Gets or sets the bit mask that specifies the week days on which the event recurs.
Public propertyFirstDayOfWeek
Gets or sets the day on which the week starts.
Public propertyFrequency
Gets or sets the frequency of recurrence.
Public propertyInterval
Gets or sets the interval of recurrence.
Public propertyMonth
Gets or sets the month on which the event recurs.

The properties of the RecurrencePattern class work together to define a complete pattern definition to be used by the RecurrenceRule engine.

You should not need to work with it directly as specialized RecurrenceRule classes are provided for the supported modes of recurrence. They take care of constructing appropriate RecurrencePattern objects.

using System;
using Kettic.AspNet.Controls;

namespace RecurrenceExamples
    class RecurrencePatternExample
        static void Main()
            // Creates a sample appointment that starts at 6/1/2007 3:30 PM 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 for the appointment.
            DailyRecurrenceRule rrule = new DailyRecurrenceRule(1, range);

            // Displays the relevant parts of the generated pattern:
            Console.WriteLine("The active recurrence pattern is:");
            Console.WriteLine("  Frequency: {0}", rrule.Pattern.Frequency);
            Console.WriteLine("  Interval: {0}", rrule.Pattern.Interval);
            Console.WriteLine("  Days of week: {0}\n", rrule.Pattern.DaysOfWeekMask);

            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:

The active recurrence pattern is:
  Frequency: Daily
  Interval: 1
  Days of week: EveryDay

Appointment occurrs at the following times:
 1: 6/1/2007 3:30:00 PM
 2: 6/2/2007 3:30:00 PM
 3: 6/3/2007 3:30:00 PM
 4: 6/4/2007 3:30:00 PM
 5: 6/5/2007 3:30:00 PM
 6: 6/6/2007 3:30:00 PM
 7: 6/7/2007 3:30:00 PM
 8: 6/8/2007 3:30:00 PM
 9: 6/9/2007 3:30:00 PM
10: 6/10/2007 3:30:00 PM*/
See Also