Share via


ListProvider Constructor

Initializes a new instance of the ListProvider class.

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

Usage

Syntax

'Declaration
Protected Sub New
protected ListProvider ()
protected:
ListProvider ()
protected ListProvider ()
protected function ListProvider ()

Example

The following code example shows how to define a class that inherits ListProvider and contains a list of business objects:

class BusinessListProvider : ListProvider<BusinessObject>
{
    protected override void RefreshAndListenForUpdates(Ilist<BusinessObject> list)
    {
        BusinessObject businessObj = new BusinessObject();
        businessObj.AdminName = "administrator1";
        businessObj.ComputerName = "Computer1";
        businessObj.Location = "Building 1";
        businessObj.System = "Windows Vista";

        list.Add(businessObj);

        businessObj = new BusinessObject();
        businessObj.AdminName = "administrator2";
        businessObj.ComputerName = "Computer2";
        businessObj.Location = "Building 2";
        businessObj.System = "Windows Vista";

        list.Add(businessObj);
    }

    protected override string GetObjectDisplayName(BusinessObject businessObj)
    {
        return businessObj.System + " " + businessObj.ComputerName;
    }

    protected override string GetObjectId(BusinessObject businessObj)
    {
        return businessObj.ComputerName;
    }

    protected override void StopListeningForUpdates()
    {
    }
}

Remarks

The code example for this constructor shows business objects that are created from a class that uses properties to make information available. Business objects can also be created from other sources, such as databases or services.

Do not display any type of user interface from the ListProvider methods that are overridden in a user-defined class. Unexpected results can occur if you display user interface objects from these methods. For example, the user interface object can be hidden from view because it was displayed behind the Administration Console. When errors occur using these methods, use the Errors property to report the errors. To display a task-based user interface, use the AsyncAction delegate method of the AsyncUiTask object or the SyncAction delegate method of the SyncUiTask object.

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

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