Muokkaa

Jaa


EventTrigger object

Scripting object that represents a trigger that starts a task when a system event occurs.

Members

The EventTrigger object has these types of members:

Properties

The EventTrigger object has these properties.

Property Access type Description
Delay
Read/write
Gets or sets a value that indicates the amount of time between when the event occurs and when the task is started.
Enabled
Read/write
Inherited from the Trigger object. Gets or sets a Boolean value that indicates whether the trigger is enabled.
EndBoundary
Read/write
Inherited from the Trigger object. Gets or sets the date and time when the trigger is deactivated. The trigger cannot start the task after it is deactivated.
ExecutionTimeLimit
Read/write
Inherited from the Trigger object. Gets or sets the maximum amount of time that the task launched by this trigger is allowed to run.
Id
Read/write
Inherited from the Trigger object. Gets or sets the identifier for the trigger.
Repetition
Read/write
Inherited from the Trigger object. Gets or sets how often the task is run and how long the repetition pattern is repeated after the task is started.
StartBoundary
Read/write
Inherited from the Trigger object. Gets or sets the date and time when the trigger is activated.
Subscription
Read/write
Gets or sets the XPath query string that identifies the event that fires the trigger.
Type
Read-only
Inherited from the Trigger object. Gets the type of the trigger.
ValueQueries
Read/write
Gets or sets a collection of named XPath queries. Each query in the collection is applied to the last matching event XML that is returned from the subscription query specified in the Subscription property. The name of the query can be used as a variable in the message of a ShowMessageAction action.

Remarks

A maximum of 500 tasks with event subscriptions can be created. An event subscription that queries for a variety of events can be used to trigger a task that uses the same action in response to the events being logged.

When reading or writing your own XML for a task, an event trigger is specified using the EventTrigger element of the Task Scheduler schema.

Examples

For more information and a code example for this scripting object, see Event Trigger Example (Scripting).

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Header
Windows.ui.xaml.h
Type library
Taskschd.tlb
DLL
Taskschd.dll

See also

Trigger

TriggerCollection

TriggerCollection.Create