Partager via


ListColumn<TBusinessObject>.IconProvider Property

 

Gets or sets the delegate method that is used to associate an instance of a business object to the Icon that is displayed with the business object value.

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

Syntax

public Converter<TBusinessObject, Icon> IconProvider { get; set; }
public:
property Converter<TBusinessObject, Icon^>^ IconProvider {
    Converter<TBusinessObject, Icon^>^ get();
    void set(Converter<TBusinessObject, Icon^>^ value);
}
Public Property IconProvider As Converter(Of TBusinessObject, Icon)

Property Value

Type: System.Converter<TBusinessObject, Icon>

An instance of a Converter<TInput, TOutput> 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.Computer 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 ListColumn<TBusinessObject> object, add the column to a ListColumnCollection<TBusinessObject>, and use a delegate method to associate an icon to an instance of a business object:

ListColumnCollection<BusinessObject> columns = null;
columns = new ListColumnCollection<BusinessObject>();

ListColumn<BusinessObject> column = null;
column = columns.Add("ComputerName", "ComputerName");
column.IsRequired = true;
column.IconProvider = GetComputerIcon;

private static Icon GetComputerIcon(BusinessObject businessObject)
{
    return Resource.Computer;
}

See Also

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

Return to top