NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

RecurrencePatterns.AddMonthlyPattern (DaysOfWeek, OccurrenceInMonth, Months, String, TimeSpan, TimeSpan, TimeSpan, DateTime, DateTime)

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, the recurrence pattern repetition rate, and the start and end dates.

[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, _
   ByVal validFrom As DateTime, _
   ByVal validUntil As DateTime _
) As MonthlyPattern
[C#]
public MonthlyPattern AddMonthlyPattern(
   DaysOfWeek daysOfWeek,
   OccurrenceInMonth recurrencePatternsInMonth,
   Months monthsOfYear,
   string patternName,
   TimeSpan startTime,
   TimeSpan endTime,
   TimeSpan interval,
   DateTime validFrom,
   DateTime validUntil
);
[C++]
public: MonthlyPattern* AddMonthlyPattern(
   DaysOfWeek daysOfWeek,
   OccurrenceInMonth recurrencePatternsInMonth,
   Months monthsOfYear,
   String* patternName,
   TimeSpan startTime,
   TimeSpan endTime,
   TimeSpan interval,
   DateTime validFrom,
   DateTime validUntil
);
[JScript]
public function AddMonthlyPattern(
   daysOfWeek : DaysOfWeek,
   recurrencePatternsInMonth : OccurrenceInMonth,
   monthsOfYear : Months,
   patternName : String,
   startTime : TimeSpan,
   endTime : TimeSpan,
   interval : TimeSpan,
   validFrom : DateTime,
   validUntil : DateTime
) : MonthlyPattern;

Parameters

daysOfWeek
The set of days in a week during which an event should occur.
recurrencePatternsInMonth
The set of recurrence patterns in a month during which an event should occur.
monthsOfYear
The set of months in a year during which an event should occur.
patternName
The name that identifies the recurrence pattern.
startTime
The time of a specific day when the recurrence pattern starts to occur.
endTime
The time of a specific day when the event stops being raised.
interval
The recurrence pattern repetition rate for a specific day.
validFrom
The date the recurrence pattern starts being valid.
validUntil
The date the recurrence pattern stops being valid.

Return Value

The MonthlyPattern.

Exceptions

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).

Remarks

When a pattern is added, the next scheduled time is automatically recalculated.

If the ValidFrom property is greater than the ValidUntil property, the values are switched.

See Also

RecurrencePatterns Class | RecurrencePatterns Members | System.Timers Namespace | RecurrencePatterns.AddMonthlyPattern Overload List | DateTime | DaysOfWeek | MonthlyPattern | Months | OccurrenceInMonth | TimeSpan