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.
Namespace: Kettic.AspNet.Controls
The RecurrenceRange type exposes the following members.
Name | Description | |
---|---|---|
![]() | RecurrenceRange |
Overloaded. Initializes a new instance of the RecurrenceRange
class.
|
![]() | RecurrenceRange(DateTime, TimeSpan, DateTime, Int32) |
Overloaded. Initializes a new instance of the RecurrenceRange
class with to the specified Start, EventDuration, RecursUntil and MaxOccurrences
values.
|
Name | Description | |
---|---|---|
![]() | Equals(Object) |
Overloaded. Overridden. Returns a value indicating whether this instance is equal
to a specified object.
(Overrides ObjectEquals(Object).) |
![]() | Equals(RecurrenceRange) |
Overloaded. Overridden. Returns a value indicating whether this instance is equal
to a specified RecurrenceRange object.
|
![]() | GetHashCode | Overriden. Returns the hash code for this instance. (Overrides ObjectGetHashCode.) |
Name | Description | |
---|---|---|
![]() ![]() | Equality |
Determines whether two specified RecurrenceRange objects have the
same value.
|
![]() ![]() | Inequality |
Determines whether two specified RecurrenceRange objects have
different values.
|
Name | Description | |
---|---|---|
![]() | EventDuration | The duration of the recurring event. |
![]() | MaxOccurrences |
Optional limit for the number of occurrences. Defaults to no limit
(Int32.MaxInt).
|
![]() | RecursUntil |
Optional end date for the recurring appointment. Defaults to no end date
(DateTime.MaxValue).
|
![]() | Start | The start of the recurring event. |
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.
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*/