Click or drag to resize
Task Scheduler Managed Class Library

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.
Inheritance Hierarchy

Namespace:  Microsoft.Win32.TaskScheduler
Assembly:  Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.10.1
Syntax
public class Task : IDisposable, IComparable, IComparable<Task>, 
	INotifyPropertyChanged
Request Example View Source

The Task type exposes the following members.

Properties
  NameDescription
Public propertyDefinition
Gets the definition of the task.
Public propertyEnabled
Gets or sets a Boolean value that indicates if the registered task is enabled.
Public propertyFolder
Gets an instance of the parent folder.
Public propertyIsActive
Gets a value indicating whether this task instance is active.
Public propertyLastRunTime
Gets the time the registered task was last run.
Public propertyCode exampleLastTaskResult
Gets the results that were returned the last time the registered task was run.
Public propertyName
Gets the name of the registered task.
Public propertyNextRunTime
Gets the time when the registered task is next scheduled to run.
Public propertyNumberOfMissedRuns
Gets the number of times the registered task has missed a scheduled run.
Public propertyPath
Gets the path to where the registered task is stored.
Public propertyReadOnly
Gets a value indicating whether this task is read only. Only available if AllowReadOnlyTasks is true.
Public propertySecurityDescriptor Obsolete.
Gets or sets the security descriptor for the task.
Public propertyState
Gets the operational state of the registered task.
Public propertyTaskService
Gets or sets the TaskService that manages this task.
Public propertyXml
Gets the XML-formatted registration information for the registered task.
Top
Methods
  NameDescription
Public methodCompareTo
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.
Public methodDispose
Releases all resources used by this class.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExport
Exports the task to the specified file in XML.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAccessControl
Gets a TaskSecurity object that encapsulates the specified type of access control list (ACL) entries for the task described by the current Task object.
Public methodGetAccessControl(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.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetInstances
Gets all instances of the currently running registered task.
Public methodGetLastRegistrationTime
Gets the last registration time, looking first at the Date value and then looking for the most recent registration event in the Event Log.
Public methodGetRunTimes
Gets the times that the registered task is scheduled to run during a specified time.
Public methodGetSecurityDescriptorSddlForm
Gets the security descriptor for the task. Not available to Task Scheduler 1.0.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnNotifyPropertyChanged
Called when a property has changed to notify any attached elements.
Public methodRegisterChanges
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.
Public methodCode exampleRun
Runs the registered task immediately.
Public methodCode exampleRunEx
Runs the registered task immediately using specified flags and a session identifier.
Public methodCode exampleSetAccessControl
Applies access control list (ACL) entries described by a TaskSecurity object to the file described by the current Task object.
Public methodSetSecurityDescriptorSddlForm
Sets the security descriptor for the task. Not available to Task Scheduler 1.0.
Public methodShowEditor
Dynamically tries to load the assembly for the editor and displays it as editable for this task.
Public methodShowPropertyPage
Shows the property page for the task (v1.0 only).
Public methodStop
Stops the registered task immediately.
Public methodToString
Returns a String that represents this instance.
(Overrides ObjectToString.)
Top
Events
  NameDescription
Public eventPropertyChanged
Occurs when a property value changes.
Top
See Also