WeeklyTrigger Class

Represents a trigger that starts a task based on a weekly schedule. For example, the task starts at 8:00 A.M. on a specific day of the week every week or every other week.


Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.11.0
[XmlRootAttribute("CalendarTrigger", Namespace = "http://schemas.microsoft.com/windows/2004/02/mit/task", 
	IsNullable = false)]
public sealed class WeeklyTrigger : Trigger, 
	ICalendarTrigger, ITriggerDelay, IXmlSerializable
Object    Trigger    WeeklyTrigger
ICalendarTrigger, ITriggerDelay, IXmlSerializable


A WeeklyTrigger runs at a specified time on specified days of the week every week or interval of weeks.


// Create a trigger that runs on Monday every third week just after midnight.
WeeklyTrigger wTrigger = new WeeklyTrigger();
wTrigger.StartBoundary = DateTime.Today + TimeSpan.FromSeconds(15);
wTrigger.DaysOfWeek = DaysOfTheWeek.Monday;
wTrigger.WeeksInterval = 3;


WeeklyTriggerCreates an unbound instance of a WeeklyTrigger.


DaysOfWeekGets or sets the days of the week on which the task runs.
EnabledGets or sets a Boolean value that indicates whether the trigger is enabled.
(Inherited from Trigger)
EndBoundary Gets or sets the date and time when the trigger is deactivated. The trigger cannot start the task after it is deactivated.


While the maximum value for this property is MaxValue, the Windows Task Scheduler management application that is part of the OS will fail if this value is greater than December 31, 9998.

(Inherited from Trigger)
ExecutionTimeLimit Gets or sets the maximum amount of time that the task launched by this trigger is allowed to run. Not available with Task Scheduler 1.0.
(Inherited from Trigger)
IdGets or sets the identifier for the trigger. Cannot set with Task Scheduler 1.0.
(Inherited from Trigger)
RandomDelayGets or sets a delay time that is randomly added to the start time of the trigger.
Repetition Gets a RepetitionPattern instance that indicates how often the task is run and how long the repetition pattern is repeated after the task is started.
(Inherited from Trigger)
StartBoundaryGets or sets the date and time when the trigger is activated.
(Inherited from Trigger)
TriggerTypeGets the type of the trigger.
(Inherited from Trigger)
WeeksIntervalGets or sets the interval between the weeks in the schedule.


CheckBindValueChecks the bind value for any conversion.
(Inherited from Trigger)
CloneCreates a new Trigger that is an unbound copy of this instance.
(Inherited from Trigger)
CompareTo Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
(Inherited from Trigger)
CopyProperties Copies the properties from another Trigger the current instance. This will not copy any properties associated with any derived triggers except those supporting the ITriggerDelay interface.
(Overrides TriggerCopyProperties(Trigger))
DisposeReleases all resources used by this class.
(Inherited from Trigger)
Equals(Object)Determines whether the specified Object, is equal to this instance.
(Inherited from Trigger)
Equals(Trigger)Indicates whether the current object is equal to another object of the same type.
(Overrides TriggerEquals(Trigger))
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeReturns a hash code for this instance.
(Inherited from Trigger)
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetUnboundValueOrDefaultTGets the unbound value or a default.
(Inherited from Trigger)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
OnNotifyPropertyChangedCalled when a property has changed to notify any attached elements.
(Inherited from Trigger)
SetRepetitionSets the repetition.
(Inherited from Trigger)
ToStringReturns a string representing this trigger.
(Inherited from Trigger)
ToString(CultureInfo)Returns a String that represents this trigger in a specific language.
(Inherited from Trigger)
V2GetTriggerStringGets the non-localized trigger string for V2 triggers.
(Overrides TriggerV2GetTriggerString)


PropertyChangedOccurs when a property value changes.
(Inherited from Trigger)


unboundValuesIn testing and may change. Do not use until officially introduced into library.
(Inherited from Trigger)

See Also