ApiInformation.IsMethodPresent ApiInformation.IsMethodPresent ApiInformation.IsMethodPresent ApiInformation.IsMethodPresent ApiInformation.IsMethodPresent Method

Definition

Overloads

IsMethodPresent(String, String) IsMethodPresent(String, String) 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.

IsMethodPresent(String, String, UInt32) IsMethodPresent(String, String, UInt32) 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.

IsMethodPresent(String, String) IsMethodPresent(String, String) 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(Platform::String typeName, Platform::String methodName)
static bool IsMethodPresent(winrt::hstring typeName, winrt::hstring methodName) const;
public static bool IsMethodPresent(String typeName, String methodName)
Public Shared Function IsMethodPresent(typeName As String, methodName As String) As bool
var bool = Windows.Foundation.Metadata.ApiInformation.isMethodPresent(typeName, methodName);

Parameters

typeName
String String String

The namespace-qualified name of the type.

methodName
String String String

The name of the method.

Returns

bool bool bool

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

Examples

if (Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.Networking.Sockets.StreamSocket", "CancelIOAsync"))
{
    Debug.WriteLine("Windows.Networking.Sockets.StreamSocket.CancelIOAsync method found");
}
else
{
    Debug.WriteLine("Windows.Networking.Sockets.StreamSocket.CancelIOAsync method NOT found");
}
See also

IsMethodPresent(String, String, UInt32) IsMethodPresent(String, String, UInt32) 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(Platform::String typeName, Platform::String methodName, unsigned int inputParameterCount)
static bool IsMethodPresent(winrt::hstring typeName, winrt::hstring methodName, uint32_t inputParameterCount) const;
public static bool IsMethodPresent(String typeName, String methodName, UInt32 inputParameterCount)
Public Shared Function IsMethodPresent(typeName As String, methodName As String, inputParameterCount As UInt32) As bool
var bool = Windows.Foundation.Metadata.ApiInformation.isMethodPresent(typeName, methodName, inputParameterCount);

Parameters

typeName
String String String

The namespace-qualified name of the type.

methodName
String String String

The name of the method.

inputParameterCount
UInt32 UInt32 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.

Examples

if (Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.Globalization.PhoneNumberFormatting.PhoneNumberFormatter", "Format", 2))
{
    Debug.WriteLine("Windows.Globalization.PhoneNumberFormatting.PhoneNumberFormatter.Format overload that takes 2 parameters was found");
}
else
{
    Debug.WriteLine("Windows.Globalization.PhoneNumberFormatting.PhoneNumberFormatter.Format overload that takes 2 parameters was NOT found");
}
See also