Api​Information Api​Information Api​Information Class

Definition

Enables you to detect whether a specified member, type, or API contract is present so that you can safely make API calls across a variety of devices.

public static class ApiInformationpublic static class ApiInformationPublic Static Class ApiInformation
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduced v1)

Methods

IsApiContractPresent(String, UInt16) IsApiContractPresent(String, UInt16) IsApiContractPresent(String, UInt16)

Returns true or false to indicate whether the API contract with the specified name and major version number is present.

public static PlatForm::Boolean IsApiContractPresent(String contractName, UInt16 majorVersion)public static bool IsApiContractPresent(String contractName, UInt16 majorVersion)Public Static Function IsApiContractPresent(contractName As String, majorVersion As UInt16) As bool
Parameters
contractName
System.String System.String System.String

The name of the API contract.

majorVersion
System.UInt16 System.UInt16 System.UInt16

The major version number of the API contract.

Returns
bool bool bool

True if the specified API contract is present; otherwise, false.

Attributes

IsApiContractPresent(String, UInt16, UInt16) IsApiContractPresent(String, UInt16, UInt16) IsApiContractPresent(String, UInt16, UInt16)

Returns true or false to indicate whether the API contract with the specified name and major and minor version number is present.

public static PlatForm::Boolean IsApiContractPresent(String contractName, UInt16 majorVersion, UInt16 minorVersion)public static bool IsApiContractPresent(String contractName, UInt16 majorVersion, UInt16 minorVersion)Public Static Function IsApiContractPresent(contractName As String, majorVersion As UInt16, minorVersion As UInt16) As bool
Parameters
contractName
System.String System.String System.String

The name of the API contract.

majorVersion
System.UInt16 System.UInt16 System.UInt16

The major version number of the API contract.

minorVersion
System.UInt16 System.UInt16 System.UInt16

The minor version number of the API contract.

Returns
bool bool bool

True if the specified API contract is present; otherwise, false.

Attributes

IsEnumNamedValuePresent(String, String) IsEnumNamedValuePresent(String, String) IsEnumNamedValuePresent(String, String)

Returns true or false to indicate whether a specified named constant is present for a specified enumeration.

public static PlatForm::Boolean IsEnumNamedValuePresent(String enumTypeName, String valueName)public static bool IsEnumNamedValuePresent(String enumTypeName, String valueName)Public Static Function IsEnumNamedValuePresent(enumTypeName As String, valueName As String) As bool
Parameters
enumTypeName
System.String System.String System.String

The namespace-qualified name of the type.

valueName
System.String System.String System.String

The name of the constant.

Returns
bool bool bool

True if the specified constant is present; otherwise, false.

Attributes

IsEventPresent(String, String) IsEventPresent(String, String) IsEventPresent(String, String)

Returns true or false to indicate whether a specified event is present for a specified type.

public static PlatForm::Boolean IsEventPresent(String typeName, String eventName)public static bool IsEventPresent(String typeName, String eventName)Public Static Function IsEventPresent(typeName As String, eventName As String) As bool
Parameters
typeName
System.String System.String System.String

The namespace-qualified name of the type.

eventName
System.String System.String System.String

The name of the event.

Returns
bool bool bool

True if the specified event is present for the type; otherwise, false.

Attributes

IsMethodPresent(String, String) IsMethodPresent(String, String) IsMethodPresent(String, String)

Returns true or false to indicate whether a specified method is present for a specified type.

public static PlatForm::Boolean IsMethodPresent(String typeName, String methodName)public static bool IsMethodPresent(String typeName, String methodName)Public Static Function IsMethodPresent(typeName As String, methodName As String) As bool
Parameters
typeName
System.String System.String System.String

The namespace-qualified name of the type.

methodName
System.String System.String System.String

The name of the method.

Returns
bool bool bool

True if the specified method is present for the type; otherwise, false.

Attributes

IsMethodPresent(String, String, UInt32) IsMethodPresent(String, String, UInt32) IsMethodPresent(String, String, UInt32)

Returns true or false to indicate whether a specified method overload with the specified number of input parameters is present for a specified type.

public static PlatForm::Boolean IsMethodPresent(String typeName, String methodName, UInt32 inputParameterCount)public static bool IsMethodPresent(String typeName, String methodName, UInt32 inputParameterCount)Public Static Function IsMethodPresent(typeName As String, methodName As String, inputParameterCount As UInt32) As bool
Parameters
typeName
System.String System.String System.String

The namespace-qualified name of the type.

methodName
System.String System.String System.String

The name of the method.

inputParameterCount
System.UInt32 System.UInt32 System.UInt32

The number of input parameters for the overload.

Returns
bool bool bool

True if the specified method is present for the type; otherwise, false.

Attributes

IsPropertyPresent(String, String) IsPropertyPresent(String, String) IsPropertyPresent(String, String)

Returns true or false to indicate whether a specified property (writeable or read-only) is present for a specified type.

public static PlatForm::Boolean IsPropertyPresent(String typeName, String propertyName)public static bool IsPropertyPresent(String typeName, String propertyName)Public Static Function IsPropertyPresent(typeName As String, propertyName As String) As bool
Parameters
typeName
System.String System.String System.String

The namespace-qualified name of the type.

propertyName
System.String System.String System.String

The name of the property.

Returns
bool bool bool

True if the specified property is present for the type; otherwise, false.

Attributes

IsReadOnlyPropertyPresent(String, String) IsReadOnlyPropertyPresent(String, String) IsReadOnlyPropertyPresent(String, String)

Returns true or false to indicate whether a specified read-only property is present for a specified type.

public static PlatForm::Boolean IsReadOnlyPropertyPresent(String typeName, String propertyName)public static bool IsReadOnlyPropertyPresent(String typeName, String propertyName)Public Static Function IsReadOnlyPropertyPresent(typeName As String, propertyName As String) As bool
Parameters
typeName
System.String System.String System.String

The namespace-qualified name of the type.

propertyName
System.String System.String System.String

The name of the property.

Returns
bool bool bool

True if the specified property is present for the type; otherwise, false.

Attributes

IsTypePresent(String) IsTypePresent(String) IsTypePresent(String)

Returns true or false to indicate whether a specified type is present.

public static PlatForm::Boolean IsTypePresent(String typeName)public static bool IsTypePresent(String typeName)Public Static Function IsTypePresent(typeName As String) As bool
Parameters
typeName
System.String System.String System.String

The namespace-qualified name of the type.

Returns
bool bool bool

True if the specified type is present; otherwise, false.

Attributes

IsWriteablePropertyPresent(String, String) IsWriteablePropertyPresent(String, String) IsWriteablePropertyPresent(String, String)

Returns true or false to indicate whether a specified writeable property is present for a specified type.

public static PlatForm::Boolean IsWriteablePropertyPresent(String typeName, String propertyName)public static bool IsWriteablePropertyPresent(String typeName, String propertyName)Public Static Function IsWriteablePropertyPresent(typeName As String, propertyName As String) As bool
Parameters
typeName
System.String System.String System.String

The namespace-qualified name of the type.

propertyName
System.String System.String System.String

The name of the property.

Returns
bool bool bool

True if the specified property is present for the type; otherwise, false.

Attributes