Task Class

Provides the methods that are used to run the task immediately, get any running instances of the task, get or set the credentials that are used to register the task, and the properties that describe the task.

Definition

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.11.1
[XmlTypeAttribute(IncludeInSchema = false)]
public class Task : IDisposable, IComparable, IComparable<Task>, 
	INotifyPropertyChanged
Inheritance
Object    Task
Derived
Implements
INotifyPropertyChanged, IComparable, IComparableTask, IDisposable

Properties

DefinitionGets the definition of the task.
EnabledGets or sets a Boolean value that indicates if the registered task is enabled.
FolderGets an instance of the parent folder.
IsActiveGets a value indicating whether this task instance is active.
LastRunTimeGets the time the registered task was last run.
LastTaskResultGets the results that were returned the last time the registered task was run.
NameGets the name of the registered task.
NextRunTimeGets the time when the registered task is next scheduled to run.
NumberOfMissedRunsGets the number of times the registered task has missed a scheduled run.
PathGets the path to where the registered task is stored.
ReadOnly Gets a value indicating whether this task is read only. Only available if AllowReadOnlyTasks is true.
SecurityDescriptorGets or sets the security descriptor for the task.
Obsolete.
StateGets the operational state of the registered task.
TaskServiceGets or sets the TaskService that manages this task.
XmlGets the XML-formatted registration information for the registered task.

Methods

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.
DisposeReleases all resources used by this class.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
ExportExports the task to the specified file in XML.
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetAccessControl Gets a TaskSecurity object that encapsulates the specified type of access control list (ACL) entries for the task described by the current Task object.
GetAccessControl(AccessControlSections) Gets a TaskSecurity object that encapsulates the specified type of access control list (ACL) entries for the task described by the current Task object.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetInstancesGets all instances of the currently running registered task.
GetLastRegistrationTime Gets the last registration time, looking first at the Date value and then looking for the most recent registration event in the Event Log.
GetRunTimesGets the times that the registered task is scheduled to run during a specified time.
GetSecurityDescriptorSddlFormGets the security descriptor for the task. Not available to Task Scheduler 1.0.
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
OnNotifyPropertyChangedCalled when a property has changed to notify any attached elements.
RegisterChanges Updates the task with any changes made to the Definition by calling RegisterTaskDefinition(String, TaskDefinition) from the currently registered folder using the currently registered name.
RunRuns the registered task immediately.
RunExRuns the registered task immediately using specified flags and a session identifier.
SetAccessControl Applies access control list (ACL) entries described by a TaskSecurity object to the file described by the current Task object.
SetSecurityDescriptorSddlFormSets the security descriptor for the task. Not available to Task Scheduler 1.0.
ShowEditorDynamically tries to load the assembly for the editor and displays it as editable for this task.
ShowPropertyPageShows the property page for the task (v1.0 only).
StopStops the registered task immediately.
ToStringReturns a String that represents this instance.
(Overrides ObjectToString)

Events

PropertyChangedOccurs when a property value changes.

See Also