Click or drag to resize
Task Scheduler Managed Class Library

TaskDefinition Class

Defines all the components of a task, such as the task settings, triggers, actions, and registration information.
Inheritance Hierarchy
SystemObject
  Microsoft.Win32.TaskSchedulerTaskDefinition

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.12.0
Syntax
C#
[SerializableAttribute]
[XmlRootAttribute("Task", Namespace = "http://schemas.microsoft.com/windows/2004/02/mit/task", 
	IsNullable = false)]
[XmlSchemaProviderAttribute("GetV1SchemaFile")]
public sealed class TaskDefinition : IDisposable, 
	IXmlSerializable, INotifyPropertyChanged
Request Example View Source

The TaskDefinition type exposes the following members.

Properties
 NameDescription
Public propertyActionsGets a collection of actions that are performed by the task.
Public propertyData Gets or sets the data that is associated with the task. This data is ignored by the Task Scheduler service, but is used by third-parties who wish to extend the task format.
Public propertyLowestSupportedVersionGets the lowest supported version that supports the settings for this TaskDefinition.
Public propertyPrincipalGets the principal for the task that provides the security credentials for the task.
Public propertyRegistrationInfo Gets a class instance of registration information that is used to describe a task, such as the description of the task, the author of the task, and the date the task is registered.
Public propertySettingsGets the settings that define how the Task Scheduler service performs the task.
Public propertyTriggersGets a collection of triggers that are used to start a task.
Public propertyXmlTextGets or sets the XML-formatted definition of the task.
Top
Methods
 NameDescription
Public methodCanUseUnifiedSchedulingEngine Determines whether this TaskDefinition can use the Unified Scheduling Engine or if it contains unsupported properties.
Public methodDisposeReleases all resources used by this class.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodStatic memberGetV1SchemaFileGets the XML Schema file for V1 tasks.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodValidateValidates the current TaskDefinition.
Top
Events
 NameDescription
Public eventPropertyChangedOccurs when a property value changes.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(TaskDefinition, Action)Implements the operator + for actions on a definition, effectively adding the action to the definition.
Public operatorStatic memberAddition(TaskDefinition, Trigger)Implements the operator + for triggers on a definition, effectively adding the trigger to the definition.
Top
Extension Methods
 NameDescription
Public Extension MethodGetFilteredAvailableActionsFiltered the supplied available actions based on this TaskDefinition and the version of the Task Scheduler.
(Defined by TaskServiceExtensions)
Public Extension MethodGetFilteredAvailableTriggersFiltered the supplied available triggers based on this TaskDefinition and the version of the Task Scheduler.
(Defined by TaskServiceExtensions)
Top
See Also