Partager via


PageContent.Create<TBusinessObject> Method (ListProvider<TBusinessObject>, ListColumnCollection<TBusinessObject>, ListGroupingCollection<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,
    ListGroupingCollection<TBusinessObject> listGroupings,
    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,
    ListGroupingCollection<TBusinessObject>^ listGroupings,
    TaskCollection^ tasks,
    Converter<TBusinessObject, DetailColumnCollection^>^ businessObjectToDetailColumns
)
Public Shared Function Create(Of TBusinessObject As Class) (
    listProvider As ListProvider(Of TBusinessObject),
    listColumns As ListColumnCollection(Of TBusinessObject),
    listGroupings As ListGroupingCollection(Of TBusinessObject),
    tasks As TaskCollection,
    businessObjectToDetailColumns As Converter(Of TBusinessObject, DetailColumnCollection)
) As PageContent

Parameters

  • 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 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(), 
        CreateGroupings(), 
        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