ApiInformation.IsApiContractPresent Method

Definition

Overloads

IsApiContractPresent(String, UInt16)

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

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.

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 bool IsApiContractPresent(Platform::String ^ contractName, unsigned short majorVersion);
/// [Windows.Foundation.Metadata.Overload("IsApiContractPresentByMajor")]
 static bool IsApiContractPresent(winrt::hstring const & contractName, unsigned short majorVersion);
[Windows.Foundation.Metadata.Overload("IsApiContractPresentByMajor")]
public static bool IsApiContractPresent(string contractName, ushort majorVersion);
function isApiContractPresent(contractName, majorVersion)
Public Shared Function IsApiContractPresent (contractName As String, majorVersion As UShort) As Boolean

Parameters

contractName
String

The name of the API contract.

majorVersion
UInt16

The major version number of the API contract.

Returns

Boolean

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

Attributes

Examples

if (Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsVoipContract", 1))
{
    Debug.WriteLine("Windows.ApplicationModel.Calls.CallsVoipContract v1.x found");
}
else
{
    Debug.WriteLine("Windows.ApplicationModel.Calls.CallsVoipContract v1.x NOT found");
}

See also

Applies to

Product Introduced

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 bool IsApiContractPresent(Platform::String ^ contractName, unsigned short majorVersion, unsigned short minorVersion);
/// [Windows.Foundation.Metadata.Overload("IsApiContractPresentByMajorAndMinor")]
 static bool IsApiContractPresent(winrt::hstring const & contractName, unsigned short majorVersion, unsigned short minorVersion);
[Windows.Foundation.Metadata.Overload("IsApiContractPresentByMajorAndMinor")]
public static bool IsApiContractPresent(string contractName, ushort majorVersion, ushort minorVersion);
function isApiContractPresent(contractName, majorVersion, minorVersion)
Public Shared Function IsApiContractPresent (contractName As String, majorVersion As UShort, minorVersion As UShort) As Boolean

Parameters

contractName
String

The name of the API contract.

majorVersion
UInt16

The major version number of the API contract.

minorVersion
UInt16

The minor version number of the API contract.

Returns

Boolean

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

Attributes

Examples

if (Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsVoipContract", 1, 1))
{
    Debug.WriteLine("Windows.ApplicationModel.Calls.CallsVoipContract v1.1 found");
}
else
{
    Debug.WriteLine("Windows.ApplicationModel.Calls.CallsVoipContract v1.1 NOT found");
}

See also

Applies to

Product Introduced