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.AddWeeklyPattern (DaysOfWeek, Int32, String, TimeSpan, TimeSpan, TimeSpan)

Adds a WeeklyPattern, given the sets of days in the week, the weekly interval, the pattern name, the start and end times, and the recurrence pattern repetition rate.

[Visual Basic]
Overloads Public Function AddWeeklyPattern( _
   ByVal daysOfWeek As DaysOfWeek, _
   ByVal everyNthWeek As Integer, _
   ByVal patternName As String, _
   ByVal startTime As TimeSpan, _
   ByVal endTime As TimeSpan, _
   ByVal interval As TimeSpan _
) As WeeklyPattern
[C#]
public WeeklyPattern AddWeeklyPattern(
   DaysOfWeek daysOfWeek,
   int everyNthWeek,
   string patternName,
   TimeSpan startTime,
   TimeSpan endTime,
   TimeSpan interval
);
[C++]
public: WeeklyPattern* AddWeeklyPattern(
   DaysOfWeek daysOfWeek,
   int everyNthWeek,
   String* patternName,
   TimeSpan startTime,
   TimeSpan endTime,
   TimeSpan interval
);
[JScript]
public function AddWeeklyPattern(
   daysOfWeek : DaysOfWeek,
   everyNthWeek : int,
   patternName : String,
   startTime : TimeSpan,
   endTime : TimeSpan,
   interval : TimeSpan
) : WeeklyPattern;

Parameters

daysOfWeek
The set of days in a week during which the event should occur.
everyNthWeek
The weekly execution interval for this recurrence pattern.
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.

Return Value

The WeeklyPattern.

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.

The properties of the pattern that are not set through parameters are set to the pattern type's default values.

See Also

RecurrencePatterns Class | RecurrencePatterns Members | System.Timers Namespace | RecurrencePatterns.AddWeeklyPattern Overload List | DaysOfWeek | TimeSpan | WeeklyPattern