Adds a new recurrence pattern to the collection.
[Visual Basic] Public Sub Add( _ ByVal recurrencePattern As IRecurrencePattern _ ) [C#] public void Add( IRecurrencePattern recurrencePattern ); [C++] public: void Add( IRecurrencePattern* recurrencePattern ); [JScript] public function Add( recurrencePattern : IRecurrencePattern );
Exception Type | Condition |
---|---|
ArgumentNullException | The recurrencePattern is a null reference (in Visual Basic Nothing). |
InvalidOperationException | The recurrencePattern parameter value is the same as one of the recurrence pattern names already in the collection. |
When a pattern is added, the next scheduled time is automatically recalculated.
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.
If you create your own recurrence patterns, use Add to add them to the collection.
RecurrencePatterns Class | RecurrencePatterns Members | System.Timers Namespace | Count | IRecurrencePattern