Partager via


PageContent.Create<TBusinessObject, TDetailBusinessObject> Method (ListProvider<TBusinessObject>, ListColumnCollection<TBusinessObject>, TaskCollection, Converter<TDetailBusinessObject, DetailColumnCollection>, Converter<TBusinessObject, TDetailBusinessObject>)

 

Initializes an 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. This method also provides additional detail information about a business object that is displayed in the details pane.

Namespace:   Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly:  Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)

Syntax

public static PageContent Create<TBusinessObject, TDetailBusinessObject>(
    ListProvider<TBusinessObject> listProvider,
    ListColumnCollection<TBusinessObject> listColumns,
    TaskCollection tasks,
    Converter<TDetailBusinessObject, DetailColumnCollection> detailBusinessObjectToDetailColumns,
    Converter<TBusinessObject, TDetailBusinessObject> businessObjectToDetailBusinessObject
)
where TBusinessObject : class
public:
generic<typename TBusinessObject, typename TDetailBusinessObject>
where TBusinessObject : ref class
static PageContent^ Create(
    ListProvider<TBusinessObject>^ listProvider,
    ListColumnCollection<TBusinessObject>^ listColumns,
    TaskCollection^ tasks,
    Converter<TDetailBusinessObject, DetailColumnCollection^>^ detailBusinessObjectToDetailColumns,
    Converter<TBusinessObject, TDetailBusinessObject>^ businessObjectToDetailBusinessObject
)
Public Shared Function Create(Of TBusinessObject As Class, TDetailBusinessObject) (
    listProvider As ListProvider(Of TBusinessObject),
    listColumns As ListColumnCollection(Of TBusinessObject),
    tasks As TaskCollection,
    detailBusinessObjectToDetailColumns As Converter(Of TDetailBusinessObject, DetailColumnCollection),
    businessObjectToDetailBusinessObject As Converter(Of TBusinessObject, TDetailBusinessObject)
) As PageContent

Parameters

  • detailBusinessObjectToDetailColumns
    Type: System.Converter<TDetailBusinessObject, DetailColumnCollection>

    A delegate method that converts an instance of a detail business object to the information that is displayed in the details pane of the page. The method takes a detail business object as an argument and returns a DetailColumnCollection.

  • businessObjectToDetailBusinessObject
    Type: System.Converter<TBusinessObject, TDetailBusinessObject>

    A delegate method that converts an instance of a business object to an instance of a detail business object.

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.
  • TDetailBusinessObject
    Represents a detail business object that includes additional or different information related to the business object that is displayed in the details pane when an item is selected in the list pane. The additional information can come from a secondary source, such as a database, file, or service.

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.

TDetailBusinessObject represents a detail business object that includes additional or different information related to the business object that is displayed in the details pane when an item is selected in the list pane. The additional information can come from a secondary source, such as a database, file, or service.

Examples

The following code example shows how to initialize a PageContent object that includes two delegate methods. One delegate method adds additional detail information to a business object, and the other delegate method converts a business object to a DetailGroup, which is contained in a DetailColumnCollection:

protected override PageContent CreateContent()
{
    PageContent page = PageContent.Create<BusinessObject>(
        CreateListProvider(), 
        CreateListColumns(), 
        CreateTasks(), 
        GetDetails, 
        ConvertBusinessObject);

    return page;
}

private static DetailColumnCollection GetDetails(DetailBusinessObject detailObj)
{
    DetailColumnCollection columns = new DetailColumnCollection();
    DetailColumn column = new DetailColumn();
    DetailGroup group = new DetailGroup("Hardware Information");

    group.Add("Computer Name", detailObj.ComputerName);
    group.Add("CPU", detailObj.Cpu);
    group.Add("Disk", detailObj.Disk);
    group.Add("RAM", detailObj.Ram);

    column.Add(group);
    columns.Add(column);

    return columns;
}

private DetailBusinessObject ConvertBusinessObject(BusinessObject businessObj)
{
    DetailBusinessObject detailObj = new DetailBusinessObject();

    detailObj.ComputerName = businessObj.ComputerName;
    detailObj.Cpu = "2.5 GHz";
    detailObj.Disk = 350 GB";
    detailObj.Ram = "4 GB";

    return detailObj;
}

See Also

Create Overload
PageContent Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace

Return to top