Partager via


ListColumn<TBusinessObject> Constructor (String, Converter<TBusinessObject, String>)

 

Initializes a new instance of the ListColumn<TBusinessObject> class with the specified display name and a display value that is obtained from a delegate method. The delegate method converts the business object to a string that is used as the value that is displayed for business objects in the column.

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

Syntax

public ListColumn(
    string displayName,
    Converter<TBusinessObject, string> displayValueProvider
)
public:
ListColumn(
    String^ displayName,
    Converter<TBusinessObject, String^>^ displayValueProvider
)
Public Sub New (
    displayName As String,
    displayValueProvider As Converter(Of TBusinessObject, String)
)

Parameters

  • displayName
    Type: System.String

    The display name of the column.

  • displayValueProvider
    Type: System.Converter<TBusinessObject, String>

    A delegate method that is used to convert an instance of a business object to the value that is displayed for the business object in the column.

Exceptions

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

Examples

The following code example shows how to define a ListColumn<TBusinessObject> object, add the object to a ListColumnCollection<TBusinessObject>, and use a delegate method to define the display value for business objects that are listed in the column:

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

ListColumn<BusinessObject> column = null;
column = columns.Add("NetworkName", GetListColumnString);
column.IsRequired = true;

private static string GetListColumnString(BusinessObject businessobj) 
{
    return businessObj.ComputerName + " " + businessObj.NetworkName; 
}

See Also

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

Return to top