DevicesManager.GetAllDevicesInfo Method ()

 

Returns a ReadOnlyDeviceInfoCollection that contains all of the DeviceInfo objects.

Namespace:   Microsoft.WindowsServerSolutions.Common.Devices
Assembly:  DevicesOM (in DevicesOM.dll)

Syntax

public ReadOnlyDeviceInfoCollection GetAllDevicesInfo()
public:
ReadOnlyDeviceInfoCollection^ GetAllDevicesInfo()
Public Function GetAllDevicesInfo As ReadOnlyDeviceInfoCollection

Return Value

Type: Microsoft.WindowsServerSolutions.Common.Devices.ReadOnlyDeviceInfoCollection

An instance of ReadOnlyDeviceInfoCollection.

Remarks

The caller of this method can subscribe to the CollectionChanged event of the collection to be informed of add or remove operations that are performed on the collection.

The ReadOnlyDeviceInfoCollection object can also be obtained from the DeviceInfoCollection property.

Examples

The following code example shows how to retrieve a collection of DeviceInfo objects.

DevicesManager dm = new DevicesManager();
dm.Connect();
ReadOnlyDeviceInfoCollection devices = dm.GetAllDevicesInfo();

// print a list of device names
foreach (DeviceInfo device in devices)
{
   Console.WriteLine("Device Name = {0}", device.DeviceName);
}

See Also

DevicesManager Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace

Return to top