Adds a MonthlyPattern, given the set of days in a week, the set of occurrence numbers in a month, the set of months in a year, the pattern name, the start and end times, and the recurrence repetition rate.
[Visual Basic] Overloads Public Function AddMonthlyPattern( _ ByVal daysOfWeek As DaysOfWeek, _ ByVal recurrencePatternsInMonth As OccurrenceInMonth, _ ByVal monthsOfYear As Months, _ ByVal patternName As String, _ ByVal startTime As TimeSpan, _ ByVal endTime As TimeSpan, _ ByVal interval As TimeSpan _ ) As MonthlyPattern [C#] public MonthlyPattern AddMonthlyPattern( DaysOfWeek daysOfWeek, OccurrenceInMonth recurrencePatternsInMonth, Months monthsOfYear, string patternName, TimeSpan startTime, TimeSpan endTime, TimeSpan interval ); [C++] public: MonthlyPattern* AddMonthlyPattern( DaysOfWeek daysOfWeek, OccurrenceInMonth recurrencePatternsInMonth, Months monthsOfYear, String* patternName, TimeSpan startTime, TimeSpan endTime, TimeSpan interval ); [JScript] public function AddMonthlyPattern( daysOfWeek : DaysOfWeek, recurrencePatternsInMonth : OccurrenceInMonth, monthsOfYear : Months, patternName : String, startTime : TimeSpan, endTime : TimeSpan, interval : TimeSpan ) : MonthlyPattern;
The MonthlyPattern.
Exception Type | Condition |
---|---|
ArgumentException | The endTime parameter value is less than 0 or greater than 23:59:59.
-or- The interval parameter value is less than 0 or greater than 23:59:59. -or- The patternName parameter value is greater than 255 characters. -or- The startTime parameter value is less than 0 or greater than 23:59:59. |
ArgumentNullException | The patternName parameter value is a null reference (in Visual Basic Nothing). |
When a pattern is added, the next scheduled time is automatically recalculated.
The properties of the pattern that are not set through parameters are set to the pattern type's default values.
RecurrencePatterns Class | RecurrencePatterns Members | System.Timers Namespace | RecurrencePatterns.AddMonthlyPattern Overload List | DaysOfWeek | MonthlyPattern | Months | OccurrenceInMonth | TimeSpan