Share via


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, uint16_t const& 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

Platform::String

winrt::hstring

The name of the API contract.

majorVersion
UInt16

unsigned short

uint16_t

The major version number of the API contract.

Returns

Boolean

bool

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");
}

Remarks

For details on finding and using API contracts, see Programming with extension SDKs.

See also

Applies to

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, uint16_t const& majorVersion, uint16_t const& 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

Platform::String

winrt::hstring

The name of the API contract.

majorVersion
UInt16

unsigned short

uint16_t

The major version number of the API contract.

minorVersion
UInt16

unsigned short

uint16_t

The minor version number of the API contract.

Returns

Boolean

bool

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");
}

Remarks

For details on finding and using API contracts, see Programming with extension SDKs.

See also

Applies to