UrlTask<TBusinessObject> Constructor (String, Converter<TBusinessObject, Uri>)
Initializes a new instance of the UrlTask<TBusinessObject> class with the specified display name and the Uri object that is returned from the specified delegate method.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
public UrlTask(
string displayName,
Converter<TBusinessObject, Uri> businessObjectToUrl
)
public:
UrlTask(
String^ displayName,
Converter<TBusinessObject, Uri^>^ businessObjectToUrl
)
Public Sub New (
displayName As String,
businessObjectToUrl As Converter(Of TBusinessObject, Uri)
)
Parameters
displayName
Type: System.StringThe display name of the task.
businessObjectToUrl
Type: System.Converter<TBusinessObject, Uri>A delegate method that is used to convert an instance of business object to a Uri object which is used to access a URL in the Web browser.
Exceptions
Exception | Condition |
---|---|
ArgumentException | displayName or businessObjectToUrl is not valid. |
ArgumentNullException | displayName or businessObjectToUrl is null. |
Remarks
TBusinessObject represents a business object that encapsulates information and methods that relate to business data or business functionality. The information in a business object is exposed as properties.
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 UrlTask<TBusinessObject> with a specified display name and a specified delegate method. The delegate method returns a Uri object, which contains information from the business object and is used to specify the URL that is accessed from the Web browser:
UrlTask<BusinessObject> urlTask = null;
urlTask = new UrlTask<BusinessObject>(
"Contoso Web Site",
GetUrlTask);
private static Uri GetUrlTask(BusinessObject businessObj)
{
Uri uriTask = new Uri(@"http://www. " +
businessObj.CompanyName +
@".com");
return uriTask
}
See Also
UrlTask<TBusinessObject> Overload
UrlTask<TBusinessObject> Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top