Click or drag to resize
RecurrenceRange Class

Specifies the time frame for which given RecurrenceRule is active. It consists of the start time of the event, it's duration and optional limits.

Inheritance Hierarchy
SystemObject
  Kettic.AspNet.ControlsRecurrenceRange

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

The RecurrenceRange type exposes the following members.

Constructors
  NameDescription
Public methodRecurrenceRange
Overloaded. Initializes a new instance of the RecurrenceRange class.
Public methodRecurrenceRange(DateTime, TimeSpan, DateTime, Int32)
Overloaded. Initializes a new instance of the RecurrenceRange class with to the specified Start, EventDuration, RecursUntil and MaxOccurrences values.
Top
Methods
  NameDescription
Public methodEquals(Object)
Overloaded. Overridden. Returns a value indicating whether this instance is equal to a specified object.
(Overrides ObjectEquals(Object).)
Public methodEquals(RecurrenceRange)
Overloaded. Overridden. Returns a value indicating whether this instance is equal to a specified RecurrenceRange object.
Public methodGetHashCode
Overriden. Returns the hash code for this instance.
(Overrides ObjectGetHashCode.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Determines whether two specified RecurrenceRange objects have the same value.
Public operatorStatic memberInequality
Determines whether two specified RecurrenceRange objects have different values.
Top
Properties
  NameDescription
Public propertyEventDuration
The duration of the recurring event.
Public propertyMaxOccurrences
Optional limit for the number of occurrences. Defaults to no limit (Int32.MaxInt).
Public propertyRecursUntil
Optional end date for the recurring appointment. Defaults to no end date (DateTime.MaxValue).
Public propertyStart
The start of the recurring event.
Top
Remarks

Limits for both occurrence count and end date can be specified via the MaxOccurrences and RecursUntil properties.

Start and EventDuration properties refer to the recurring event's start and duration. In the context of KaxScheduler they are usually derived from Start and End.

Examples
using System;
using Kettic.AspNet.Controls;

namespace RecurrenceExamples
{
    class RecurrenceRangeExample
    {
        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 daily recurrence rule for the appointment.
            DailyRecurrenceRule rrule = new DailyRecurrenceRule(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/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