Share via


ListGroupingCollection.Add Method (String, Generic Converter)

Adds a ListGrouping object to the ListGroupingCollection with the specified display name and the ListGroup object that is returned from the specified delegate method. The delegate method assigns business objects to the appropriate ListGroup.

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

Usage

Syntax

'Declaration
Public Function Add ( _
    displayName As String, _
    businessObjectToGroup As Converter(Of TBusinessObject, ListGroup(Of TBusinessObject)) _
) As ListGrouping(Of TBusinessObject)
public ListGrouping<TBusinessObject> Add (
    string displayName,
    Converter<TBusinessObject,ListGroup<TBusinessObject>> businessObjectToGroup
)
public:
ListGrouping<TBusinessObject>^ Add (
    String^ displayName, 
    Converter<TBusinessObject, ListGroup<TBusinessObject>^>^ businessObjectToGroup
)
public ListGrouping<TBusinessObject> Add (
    String displayName, 
    Converter<TBusinessObject,ListGroup<TBusinessObject>> businessObjectToGroup
)
public function Add (
    displayName : String, 
    businessObjectToGroup : Converter<TBusinessObject,ListGroup<TBusinessObject>>
) : ListGrouping<TBusinessObject>

Parameters

  • displayName
    The display name of the list group.
  • businessObjectToGroup
    A delegate method that converts an instance of a business object to the ListGroup of which it is a member.

Return Value

An instance of ListGrouping that was added to the ListGroupingCollection.

Example

The following code example shows how to initialize a new ListGroupingCollection, add a new ListGrouping to the ListGroupingCollection, and use a delegate method to associate objects to the group:

ListGroupingCollection<BusinessObject> groupings = null;
groupings = new ListGroupingCollection<BusinessObject>();
ListGrouping<BusinessObject> grouping = null;
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;
}

Exceptions

Exception type Condition
ArgumentException

One or more of the parameters are not valid.

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

ListGroupingCollection Generic Class
ListGroupingCollection Members
Microsoft.EssentialBusinessServer.Console.ObjectModel Namespace