RecurrenceRecurYearly(DayOccurrence, DaysOfWeek, Int32, Int32) Method
Initialize a yearly recurrence pattern that occurs on a specific occurrence of a day of the week in
the specified month at the specified yearly interval (i.e. the last Sunday in September every year).
Namespace: EWSoftware.PDIAssembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2023.1.2.0
public void RecurYearly(
DayOccurrence occur,
DaysOfWeek daysOfWeek,
int month,
int recurInterval
)
Public Sub RecurYearly (
occur As DayOccurrence,
daysOfWeek As DaysOfWeek,
month As Integer,
recurInterval As Integer
)
public:
void RecurYearly(
DayOccurrence occur,
DaysOfWeek daysOfWeek,
int month,
int recurInterval
)
member RecurYearly :
occur : DayOccurrence *
daysOfWeek : DaysOfWeek *
month : int *
recurInterval : int -> unit
Parameters
- occur DayOccurrence
- The occurrence of the day of the week on which to occur
- daysOfWeek DaysOfWeek
- The day of the week on which to occur
- month Int32
- The month in which to occur.
- recurInterval Int32
- The interval between occurrences in years
This is a convenience method that mimics the yearly recurrence pattern in Microsoft Outlook.
When called, it sets up the recurrence for a yearly pattern that recurs at the specified interval on
the specified occurrence of the days of the week. All rule parts are cleared prior to setting the
monthly options but other parameters such as the start date are left alone.
// Test yearly recurrence
rRecur.RecurYearly(5, 24, 1);
rRecur.StartDateTime = DateTime.Today;
rRecur.RecurUntil = DateTime.Today.AddYears(5);
// With a collection
Dim recurDates = rRecur.InstancesBetween(DateTime.Today,
DateTime.Today.AddYears(5));
// Using the enumerator
foreach(DateTime dt in recurDates)
Console.WriteLine("Yearly recurrence on: {0:d}", dt);
foreach(DateTime dt in rRecur)
Console.WriteLine("Yearly recurrence on: {0:d}", dt);
// Test yearly recurrence
rRecur.RecurYearly(DayOccurrence.Last, DaysOfWeek.Sunday, 9, 2);
rRecur.StartDateTime = DateTime.Today;
// With a collection
recurDates = rRecur.InstancesBetween(DateTime.Today, DateTime.Today.AddYears(5));
foreach(DateTime dt in recurDates)
Console.WriteLine("Yearly recurrence on: {0:d}", dt);
// Using the enumerator
foreach(DateTime dt in rRecur)
Console.WriteLine("Yearly recurrence on: {0:d}", dt);
' Test yearly recurrence
rRecur.RecurYearly(5, 24, 1)
rRecur.StartDateTime = DateTime.Today
rRecur.RecurUntil = DateTime.Today.AddYears(5)
' With a collection
Dim recurDates As DateTimeCollection = rRecur.InstancesBetween(DateTime.Today,
DateTime.Today.AddYears(5))
' Using the enumerator
For Each dt In recurDates
Console.WriteLine("Yearly recurrence on: {0:d}", dt)
Next
For Each dt In rRecur
Console.WriteLine("Yearly recurrence on: {0:d}", dt)
Next
' Test yearly recurrence
rRecur.RecurYearly(DayOccurrence.Last, DaysOfWeek.Sunday, 9, 2)
rRecur.StartDateTime = DateTime.Today
' With a collection
recurDates = rRecur.InstancesBetween(DateTime.Today, DateTime.Today.AddYears(5))
For Each dt In recurDates
Console.WriteLine("Yearly recurrence on: {0:d}", dt)
Next
' Using the enumerator
For Each dt In rRecur
Console.WriteLine("Yearly recurrence on: {0:d}", dt)
Next
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.