Specifies a collection of recurrence patterns that describe the Schedule component's behavior when raising events.
Object
RecurrencePatterns
[Visual Basic] Public Class RecurrencePatterns Implements ICollection, IEnumerable [C#] public class RecurrencePatterns : ICollection, IEnumerable [C++] public __gc class RecurrencePatterns : public ICollection, IEnumerable [JScript] public class RecurrencePatterns implements ICollection, IEnumerable
RecurrencePatterns lets you store various recurrence patterns. A Schedule uses this collection to determine when to raise one or more events.
Note RecurrencePatterns is used only in conjunction with Schedule. Before using RecurrencePatterns, first create an instance of Schedule, then use the RecurrencePatterns property to define your RecurrencePatterns collection.
There are two ways to add a recurrence pattern to the collection. Use Add if you have a recurrence pattern that is previously defined. If you define a recurrence pattern before adding it to the collection, you can add it to multiple RecurrencePatterns collections without making a copy of the recurrence pattern. However, if you use one of the AddDailyPattern, AddDaysOfMonthPattern, AddMonthlyPattern, or AddWeeklyPattern methods, you will create the recurrence pattern while adding it to the collection. Only recurrence patterns appended through Add can be used in other collections.
CAUTION Recurrence patterns defined through AddDailyPattern, AddDaysOfMonthPattern, AddMonthlyPattern, or AddWeeklyPattern will be deleted and lost if Clear is called.
Combine various recurrence patterns to get the ultimate pattern you want. It is important to understand how combinations work together. For example, you want an event raised at 4:00am and 4:00pm on the 1st and 15th of every month, and the first Monday of July at 2:00pm, on every third Wednesday and Friday at 3:00pm, and every 4 days at 1:00pm starting from the date the pattern becomes valid, you will need to define several patterns. First, create DaysOfMonthPattern1 to raise the event at 4:00am on the 1st and 15th of every month, then create DaysOfMonthPattern2 to raise the event at 4:00pm on the 1st and 15th of every month. Next, create MonthlyPattern1 to raise the event on the first Monday of July at 2:00pm. Fourth, create WeeklyPattern1 which raises the event on Wednesday and Friday at 3:00pm with the EveryNthWeek property equal to 3. Finally, create DailyPattern1 to raise the event at 1:00pm every 4 days, starting the specified valid start date. For more information on creating and using these patterns, see DailyPattern, DaysOfMonthPattern, MonthlyPattern, and WeeklyPattern.
RecurrencePatterns is not intended to contain all of your collections. Only add the recurrence patterns that you want to apply to the corresponding instance of Schedule.
Namespace: System.Timers
Assembly: System.Timers.dll
RecurrencePatterns Members | System.Timers Namespace | DailyPattern | DaysOfMonthPattern | IRecurrencePattern | MonthlyPattern | RecurrencePattern | Schedule | Timer | WeeklyPattern