Share via


PageContent.Create Generic Method (Generic ListProvider, Generic ListColumnCollection, Generic ListGroupingCollection, TaskCollection, Generic Converter)

Initializes a new instance of the PageContent class that is used by a page in the Administration Console to provide a list pane, a task pane, and a details pane. This method also provides information for grouping data in the list pane of the page.

Namespace: Microsoft.EssentialBusinessServer.Console.ObjectModel
Assembly: Microsoft.EssentialBusinessServer.Console.ObjectModel (in microsoft.essentialbusinessserver.console.objectmodel.dll)

Usage

Syntax

'Declaration
Public Shared Function Create(Of TBusinessObject) ( _
    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
public static PageContent Create<TBusinessObject> (
    ListProvider<TBusinessObject> listProvider,
    ListColumnCollection<TBusinessObject> listColumns,
    ListGroupingCollection<TBusinessObject> listGroupings,
    TaskCollection tasks,
    Converter<TBusinessObject,DetailColumnCollection> businessObjectToDetailColumns
)
public:
generic<typename TBusinessObject>
static PageContent^ Create (
    ListProvider<TBusinessObject>^ listProvider, 
    ListColumnCollection<TBusinessObject>^ listColumns, 
    ListGroupingCollection<TBusinessObject>^ listGroupings, 
    TaskCollection^ tasks, 
    Converter<TBusinessObject, DetailColumnCollection^>^ businessObjectToDetailColumns
)

Parameters

  • listProvider
    A ListProvider object that returns instances of business objects for use within the page.
  • tasks
    A TaskCollection object that provides the tasks in the task pane of the page.
  • businessObjectToDetailColumns
    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

An instance of PageContent.

Example

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;
}

Exceptions

Exception type 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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2008 64-bit Edition, Windows Vista 64-bit Edition, Windows Essential Business Server 2008 Standard, Windows Essential Business Server 2008 Premium

Target Platforms

Windows Essential Business Server 2008 Standard, Windows Essential Business Server 2008 Premium

See Also

Reference

PageContent Class
PageContent Members
Microsoft.EssentialBusinessServer.Console.ObjectModel Namespace