ProcessTask<TBusinessObject> Constructor (String, ProcessTaskStartInfo)
Initializes a new instance of the ProcessTask<TBusinessObject> class with the specified display name and the specified ProcessTaskStartInfo object.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
public ProcessTask(
string displayName,
ProcessTaskStartInfo startInfo
)
public:
ProcessTask(
String^ displayName,
ProcessTaskStartInfo^ startInfo
)
Public Sub New (
displayName As String,
startInfo As ProcessTaskStartInfo
)
Parameters
displayName
Type: System.StringThe display name of the task.
startInfo
Type: Microsoft.WindowsServerSolutions.Administration.ObjectModel.ProcessTaskStartInfoA ProcessTaskStartInfo object that contains information about how to run the program.
Exceptions
Exception | Condition |
---|---|
ArgumentException | One or more of the parameters are not valid. |
ArgumentNullException | One or more of the parameters are null. |
Remarks
After a task has been initialized, it must be added to a TaskCollection to be included in the task pane of the Dashboard.
Examples
The following code example shows how to initialize a ProcessTask<TBusinessObject> with a specified display name and a specified ProcessTaskStartInfo object:
ProcessTaskStartInfo taskInfo = null;
taskInfo = new ProcessTaskStartInfo();
taskInfo.Arguments = "newfile.txt";
taskInfo.FileName = "notepad.exe";
ProcessTask<BusinessObject> businessTask = new ProcessTask<BusinessObject>("Create New File", taskInfo);
See Also
ProcessTask<TBusinessObject> Overload
ProcessTask<TBusinessObject> Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top