DeviceInformation.CreateFromIdAsync DeviceInformation.CreateFromIdAsync DeviceInformation.CreateFromIdAsync DeviceInformation.CreateFromIdAsync DeviceInformation.CreateFromIdAsync Method

Definition

Overloads

CreateFromIdAsync(String) CreateFromIdAsync(String) CreateFromIdAsync(String) CreateFromIdAsync(String) CreateFromIdAsync(String)

Creates a DeviceInformation object from a DeviceInformation ID.

CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>)

Creates a DeviceInformation object from a DeviceInformation ID and a list of additional properties.

CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind)

Creates a DeviceInformation object from a DeviceInformation ID, a list of additional properties, and a DeviceInformationKind parameter.

CreateFromIdAsync(String) CreateFromIdAsync(String) CreateFromIdAsync(String) CreateFromIdAsync(String) CreateFromIdAsync(String)

Creates a DeviceInformation object from a DeviceInformation ID.

public : static IAsyncOperation<DeviceInformation> CreateFromIdAsync(Platform::String deviceId)
static IAsyncOperation<DeviceInformation> CreateFromIdAsync(winrt::hstring deviceId) const;
public static IAsyncOperation<DeviceInformation> CreateFromIdAsync(String deviceId)
Public Shared Function CreateFromIdAsync(deviceId As String) As IAsyncOperation(Of DeviceInformation)
Windows.Devices.Enumeration.DeviceInformation.createFromIdAsync(deviceId).done( /* Your success and error handlers */ );

Parameters

deviceId
String String String

The device ID.

Returns

An object for starting and managing the asynchronous creation of the DeviceInformation object.

Examples

The savedId variable in this example is a DeviceInformation ID previously saved by the application, obtained from the id property of the last-used DeviceInformation object.


    // Create a DeviceInformation object from a saved ID
    var Enum = Windows.Devices.Enumeration;
    var DevInf = Enum.DeviceInformation;
    DevInf.createFromIdAsync(savedId).then(
        function(devinfo) {
            // Use the created DeviceInformation object
            printMessage("Created DeviceInformation. Name: " + devinfo.name);
        },
        function (e) {
            displayError("Failed to create DeviceInformation: " + e.message);
        });

See also

CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>) CreateFromIdAsync(String, IIterable<String>)

Creates a DeviceInformation object from a DeviceInformation ID and a list of additional properties.

public : static IAsyncOperation<DeviceInformation> CreateFromIdAsync(Platform::String deviceId, IIterable<Platform::String> additionalProperties)
static IAsyncOperation<DeviceInformation> CreateFromIdAsync(winrt::hstring deviceId, IIterable<winrt::hstring> additionalProperties) const;
public static IAsyncOperation<DeviceInformation> CreateFromIdAsync(String deviceId, IEnumerable<String> additionalProperties)
Public Shared Function CreateFromIdAsync(deviceId As String, additionalProperties As IEnumerable(Of String)) As IAsyncOperation(Of DeviceInformation)
Windows.Devices.Enumeration.DeviceInformation.createFromIdAsync(deviceId, additionalProperties).done( /* Your success and error handlers */ );

Parameters

deviceId
String String String

A string containing the DeviceInformation ID.

additionalProperties
IEnumerable<String> IEnumerable<String> IEnumerable<String>

An iterable list of additional properties to include in the Properties property of the DeviceInformation objects in the enumeration results. For more info on what the properties represent, see Device information properties.

Returns

An object for starting and managing the asynchronous creation of the DeviceInformation object.

Examples

The following example builds a list of properties to include in the DeviceInformation object to create from a DeviceInformation ID.The savedId variable in this example is a DeviceInformation ID previously saved by the application, obtained from the id property of the last-used DeviceInformation object.


    // Create a set of two additional properties
    var propertiesToRetrieve = new Array();
    propertiesToRetrieve.push("System.InterfaceClassGuid");
    propertiesToRetrieve.push("System.Storage.IsPortable");

    // Create a DeviceInformation object from a saved ID
    var Enum = Windows.Devices.Enumeration;
    var DevInf = Enum.DeviceInformation;
    DevInf.createFromIdAsync(savedId, propertiesToRetrieve).then(
        function(devinfo) {
            // Use the created DeviceInformation object
            printMessage("Created DeviceInformation. Name: " + devinfo.name);
        },
        function (e) {
            displayError("Failed to create DeviceInformation: " + e.message);
        });



See also

CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind) CreateFromIdAsync(String, IIterable<String>, DeviceInformationKind)

Creates a DeviceInformation object from a DeviceInformation ID, a list of additional properties, and a DeviceInformationKind parameter.

public : static IAsyncOperation<DeviceInformation> CreateFromIdAsync(Platform::String deviceId, IIterable<Platform::String> additionalProperties, DeviceInformationKind kind)
static IAsyncOperation<DeviceInformation> CreateFromIdAsync(winrt::hstring deviceId, IIterable<winrt::hstring> additionalProperties, DeviceInformationKind kind) const;
public static IAsyncOperation<DeviceInformation> CreateFromIdAsync(String deviceId, IEnumerable<String> additionalProperties, DeviceInformationKind kind)
Public Shared Function CreateFromIdAsync(deviceId As String, additionalProperties As IEnumerable(Of String), kind As DeviceInformationKind) As IAsyncOperation(Of DeviceInformation)
Windows.Devices.Enumeration.DeviceInformation.createFromIdAsync(deviceId, additionalProperties, kind).done( /* Your success and error handlers */ );

Parameters

deviceId
String String String

A string containing the DeviceInformation ID.

additionalProperties
IEnumerable<String> IEnumerable<String> IEnumerable<String>

An iterable list of additional properties to include in the Properties property of the DeviceInformation objects in the enumeration results. For more info on what the properties represent, see Device information properties.

Returns

An object for starting and managing the asynchronous creation of the DeviceInformation object.

See also