Click or drag to resize
YearlyRecurrenceRule Class
Occurrences of this rule repeat on a yearly basis.
Inheritance Hierarchy
SystemObject
  Kettic.AspNet.ControlsRecurrenceRule
    Kettic.AspNet.ControlsYearlyRecurrenceRule

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
[SerializableAttribute]
public class YearlyRecurrenceRule : RecurrenceRule

The YearlyRecurrenceRule type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleYearlyRecurrenceRule(RecurrenceMonth, Int32, RecurrenceRange)
Initializes a new instance of the YearlyRecurrenceRule class.
Public methodCode exampleYearlyRecurrenceRule(Int32, RecurrenceMonth, RecurrenceDay, RecurrenceRange)
Initializes a new instance of the YearlyRecurrenceRule class.
Top
Properties
  NameDescription
Public propertyDayOfMonth
Gets the day of month on which the event recurs.
Public propertyDayOrdinal
Gets the day ordinal modifier. See DayOrdinal for additional information.
Public propertyDaysOfWeekMask
Gets the bit mask that specifies the week days on which the event recurs.
Public propertyMonth
Gets the month in which the event recurs.
Top
Examples
using System;
using Kettic.AspNet.Controls;

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