RecurrenceRuleSetEffectiveRange Method |
Specifies the effective range for evaluating occurrences.
Namespace: Kettic.AspNet.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax public void SetEffectiveRange(
DateTime start,
DateTime end
)
Public Sub SetEffectiveRange (
start As DateTime,
end As DateTime
)
public:
void SetEffectiveRange(
DateTime start,
DateTime end
)
member SetEffectiveRange :
start : DateTime *
end : DateTime -> unit
Parameters
- start
- Type: SystemDateTime
The starting date of the effective range. - end
- Type: SystemDateTime
The ending date of the effective range.
Exceptions Exception | Condition |
---|
ArgumentException | End date is before Start date. |
Remarks Examples using System;
using Kettic.AspNet.Controls;
namespace RecurrenceExamples
{
class EffectiveRangeExample
{
static void Main()
{
Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
RecurrenceRange range = new RecurrenceRange();
range.Start = recurringAppointment.Start;
range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
range.MaxOccurrences = 10;
HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(2, range);
rrule.SetEffectiveRange(Convert.ToDateTime("6/1/2007 5:00 PM"), Convert.ToDateTime("6/1/2007 8:00 PM"));
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());
}
}
}
}
Imports System
Imports Kettic.AspNet.Controls
Namespace RecurrenceExamples
Class EffectiveRangeExample
Shared Sub Main()
Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
Dim range As New RecurrenceRange()
range.Start = recurringAppointment.Start
range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
range.MaxOccurrences = 10
Dim rrule As New HourlyRecurrenceRule(2, range)
rrule.SetEffectiveRange(Convert.ToDateTime("6/1/2007 5:00 PM"), Convert.ToDateTime("6/1/2007 8:00 PM"))
Console.WriteLine("Appointment occurrs at the following times: ")
Dim ix As Integer = 0
For Each occurrence As DateTime In rrule.Occurrences
ix = ix + 1
Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
Next
End Sub
End Class
End Namespace
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also