ListGroup<TBusinessObject>.IconProvider Property
Gets or sets a delegate method that is used to associate an icon to a collection of business objects that are represented by a ListGroup<TBusinessObject> object.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
public Converter<ReadOnlyCollection<TBusinessObject>, Icon> IconProvider { get; set; }
public:
property Converter<ReadOnlyCollection<TBusinessObject>^, Icon^>^ IconProvider {
Converter<ReadOnlyCollection<TBusinessObject>^, Icon^>^ get();
void set(Converter<ReadOnlyCollection<TBusinessObject>^, Icon^>^ value);
}
Public Property IconProvider As Converter(Of ReadOnlyCollection(Of TBusinessObject), Icon)
Property Value
Type: System.Converter<ReadOnlyCollection<TBusinessObject>, Icon>
An instance of a Converter delegate method.
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.
The Dashboard manages the lifetime of an icon instance that is returned from a delegate method. When you implement the delegate method, always return a new instance of an icon object. Do not return an existing reference to an icon object. It is acceptable to get a new instance of an icon from the Resource object. For example, the Resource.Network object in the previous example is a new instance of an icon that is returned by the user-defined delegate method.
Examples
The following code example shows how to define a ListGroup<TBusinessObject> and a delegate method that is used to associate an icon to a collection of business objects:
ListGroupingCollection<BusinessObject> groupings = null;
groupings = new ListGroupingCollection<BusinessObject>();
ListGrouping<BusinessObject> grouping = null;
grouping = groupings.Add("Network Name", GetObjectListGroup);
groupings.DefaultGrouping = grouping;
private static ListGroup<BusinessObject> GetObjectListGroup(
BusinessObject businessObject)
{
ListGroup<BusinessObject> group = null;
group = new ListGroup<BusinessObject>(businessObject.NetworkName);
group.IconProvider = GetGroupIcon;
return group;
}
private static Icon GetGroupIcon(
ReadOnlyCollection<BusinessObject> businessObjects)
{
return Resource.Network;
}
See Also
ListGroup<TBusinessObject> Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top