PageContent.Create<TBusinessObject> Method (ListProvider<TBusinessObject>, ListColumnCollection<TBusinessObject>, TaskCollection, Converter<TBusinessObject, DetailColumnCollection>)
Initializes a new instance of the PageContent class that is used by a page in the Dashboard to provide a list pane, a task pane, and a details pane.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
public static PageContent Create<TBusinessObject>(
ListProvider<TBusinessObject> listProvider,
ListColumnCollection<TBusinessObject> listColumns,
TaskCollection tasks,
Converter<TBusinessObject, DetailColumnCollection> businessObjectToDetailColumns
)
where TBusinessObject : class
public:
generic<typename TBusinessObject>
where TBusinessObject : ref class
static PageContent^ Create(
ListProvider<TBusinessObject>^ listProvider,
ListColumnCollection<TBusinessObject>^ listColumns,
TaskCollection^ tasks,
Converter<TBusinessObject, DetailColumnCollection^>^ businessObjectToDetailColumns
)
Public Shared Function Create(Of TBusinessObject As Class) (
listProvider As ListProvider(Of TBusinessObject),
listColumns As ListColumnCollection(Of TBusinessObject),
tasks As TaskCollection,
businessObjectToDetailColumns As Converter(Of TBusinessObject, DetailColumnCollection)
) As PageContent
Parameters
listProvider
Type: Microsoft.WindowsServerSolutions.Administration.ObjectModel.ListProvider<TBusinessObject>A ListProvider<TBusinessObject> object that returns instances of business objects for use within the page.
listColumns
Type: Microsoft.WindowsServerSolutions.Administration.ObjectModel.ListColumnCollection<TBusinessObject>A ListColumnCollection<TBusinessObject> object that provides the columns in the list pane of the page.
tasks
Type: Microsoft.WindowsServerSolutions.Administration.ObjectModel.TaskCollectionA TaskCollection object that provides the tasks in the task pane of the page.
businessObjectToDetailColumns
Type: System.Converter<TBusinessObject, DetailColumnCollection>A delegate method that converts an instance of a business object into the information that is displayed in the details pane of the page. The delegate method takes a business object as an argument and returns a DetailColumnCollection.
Return Value
Type: Microsoft.WindowsServerSolutions.Administration.ObjectModel.PageContent
An instance of PageContent.
Type Parameters
- TBusinessObject
Represents a business object that encapsulates information and methods that relate to business data or business functionality. The information in the business object is exposed as properties.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | One or more of the parameters are null. |
Remarks
TBusinessObject represents a business object that encapsulates information and methods that relate to business data or business functionality. The information in the business object is exposed as properties.
Examples
The following code example shows how to initialize a PageContent object that includes a delegate method, which converts a business object to a DetailGroup. The DetailGroup is contained in a DetailColumnCollection:
protected override PageContent CreateContent()
{
PageContent page = PageContent.Create<BusinessObject>(CreateListProvider(), CreateListColumns(), CreateTasks(), GetDetails);
return page;
}
private static DetailColumnCollection GetDetails(BusinessObject businessObj)
{
DetailColumnCollection columns = new DetailColumnCollection();
DetailColumn column = new DetailColumn();
DetailGroup group = new DetailGroup("Computer Information");
group.Add("Computer Name", businessObj.ComputerName);
group.Add("Network Name", businessObj.NetworkName);
group.Add("Operating System", businessObj.SystemVersion);
column.Add(group);
columns.Add(column);
return columns;
}
See Also
Create Overload
PageContent Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top