DeviceCapabilities Class

Represents a device's capabilities. This class cannot be inherited.

Namespace: Microsoft.SideShow
Assembly: Microsoft.SideShow (in microsoft.sideshow.dll)

Usage

Syntax

'Declaration
Public NotInheritable Class DeviceCapabilities
public sealed class DeviceCapabilities
public ref class DeviceCapabilities sealed
public final class DeviceCapabilities
public final class DeviceCapabilities

Example

The following code illustrates how to display the number of connected devices, each device's ID, and some of the capabilities of the devices.

private static void SampleDeviceCapabilities()
{
    // Set the gadget's GUID.
    Guid gadgetId = new Guid("{0530B726-F6D5-4a66-900E-3C7673316F3B}");
    
    // Register the gadget.
    GadgetRegistration.Register(
        false,                           // Register gadget for current user only
        gadgetId,                        // Guid for the registry subkey
        ScfSideShowGadget.ScfEndpointId, // Endpoints registry value
        "Example SideShow gadget",       // FriendlyName registry value
        null,                            // StartCommand registry value
        null,                            // Icon registry value, this gadget will use the generic gadget icon.
        false,                           // OnlineOnly registry value
        GadgetCachePolicies.KeepNewest,  // CachePolicy registry value
        null);

    // Connected SideShow device capabilities.
    using (ScfSideShowGadget gadget = new ScfSideShowGadget(gadgetId))
    {
        // Display the number of connected SideShow devices.
        Console.WriteLine("Device count=" + gadget.GetDeviceCount());
        // Get the capabilities for each connected SideShow device.
        DeviceCapabilities[] caps = gadget.GetCapabilitiesForDevices();
        // Display the DeviceId, ScreenHeight, ScreenWidth, ColorDepth and SupportedImageFormats for each connected SideShow device.
        for (Int32 n = 0; n < caps.Length; n++)
        {
            Console.WriteLine("Device #{0} has ID of {1}", n, caps[n].GetDeviceId());
            Console.WriteLine("Device #{0} has a screen height of {1}", n, caps[n].GetScreenHeight());
            Console.WriteLine("Device #{0} has a screen width of {1}", n, caps[n].GetScreenWidth());
            Console.WriteLine("Device #{0} has a color depth of {1}", n, caps[n].GetColorDepth());
            Console.WriteLine("Device #{0} supports the following image formats: {1}", n, caps[n].GetSupportedImageFormats());
        }
    }
}

Remarks

If your gadget displays images, you should query for device capabilities, and tailor the image to the device. Some devices cannot display large images. If an image exceeding the device’s maximum image size is sent to the device, it will not be displayed.

Inheritance Hierarchy

System.Object
  Microsoft.SideShow.DeviceCapabilities

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

Target Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

See Also

Reference

DeviceCapabilities Members
Microsoft.SideShow Namespace