Partager via


ListGrouping<TBusinessObject> Constructor (String, Converter<TBusinessObject, ListGroup<TBusinessObject>>)

 

Initializes a new instance of the ListGrouping<TBusinessObject> class with the specified display name and the specified delegate method. The delegate method converts an instance of a business object to the ListGroup<TBusinessObject> of which it is a member.

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

Syntax

public ListGrouping(
    string displayName,
    Converter<TBusinessObject, ListGroup<TBusinessObject>> businessObjectToGroup
)
public:
ListGrouping(
    String^ displayName,
    Converter<TBusinessObject, ListGroup<TBusinessObject>^>^ businessObjectToGroup
)
Public Sub New (
    displayName As String,
    businessObjectToGroup As Converter(Of TBusinessObject, ListGroup(Of TBusinessObject))
)

Parameters

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 define a ListGrouping<TBusinessObject> object, add the object to a ListGroupingCollection<TBusinessObject>, and use a delegate method to define a ListGroup<TBusinessObject> that gets a display value for the group from a business object:

ListGroupingCollection<BusinessObject> groupings = null;
groupings = new ListGroupingCollection<BusinessObject>();

ListGrouping<BusinessObject> grouping = groupings.Add(
    "Network Name",
    GetObjectListGroup);

private static ListGroup<BusinessObject> GetObjectListGroup(
    BusinessObject businessObj)
{
    ListGroup<BusinessObject> group = null;
    group = new ListGroup<BusinessObject>(businessObj.NetworkName);

    return group;
}

See Also

ListGrouping<TBusinessObject> Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace

Return to top