TaskCollection.Add Method (Task)
Adds the specified Task object to the TaskCollection.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
public void Add(
Task item
)
public:
virtual void Add(
Task^ item
) sealed
Public Sub Add (
item As Task
)
Parameters
item
Type: Microsoft.WindowsServerSolutions.Administration.ObjectModel.TaskThe Task object that is added to the TaskCollection.
Implements
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | item is null. |
Remarks
The following table lists the types of tasks that can be defined and added to the TaskCollection.
Task |
Description |
---|---|
ProcessTask<TBusinessObject> Generic |
Enables a program to be run that is associated to an item, which is selected in the list pane. |
Enables a program to be run that is not associated to any item in the list pane. |
|
UrlTask<TBusinessObject> Generic |
Starts a Web browser and accesses a URL that is associated to an item, which is selected in the list pane. |
Starts a Web browser and accesses a URL that is not associated to items in the list pane. |
|
SyncUiTask<TBusinessObject> Generic |
Enables a user interface process to be started that is associated to an item, which is selected in the list pane. This task blocks actions in the Dashboard until the process is completed. |
Enables a user interface process to be started that is not associated to any items in the list pane. This task blocks actions in the Dashboard until the process is completed. |
|
AsyncUiTask<TBusinessObject> Generic |
Enables a user interface process to be started that is associated to an item, which is selected in the list pane. This task does not block actions in the Dashboard. |
Enables a user interface process to be started that is not associated to any items in the list pane. This task does not block actions in the Dashboard. |
BusinessObject represents a business object that encapsulates information and methods, which relate to business data or business functionality. The information in a business object is usually exposed as properties.
Examples
The following code example shows how to initialize a task, which is associated to an item that is selected in the list pane, and adds the task to a TaskCollection:
ProcessTask<BusinessObject> pageTask = null;
pageTask = new ProcessTask<BusinessObject>("Page Task", "program.exe");
TaskCollection taskList = new TaskCollection();
taskList.Add(pageTask);
See Also
TaskCollection Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top