Compartir a través de


ApiInformation.IsMethodPresent Método

Definición

Sobrecargas

IsMethodPresent(String, String)

Devuelve true o false para indicar si un método especificado está presente para un tipo especificado.

IsMethodPresent(String, String, UInt32)

Devuelve true o false para indicar si existe una sobrecarga de método especificada con el número especificado de parámetros de entrada para un tipo especificado.

IsMethodPresent(String, String)

Devuelve true o false para indicar si un método especificado está presente para un tipo especificado.

public:
 static bool IsMethodPresent(Platform::String ^ typeName, Platform::String ^ methodName);
/// [Windows.Foundation.Metadata.Overload("IsMethodPresent")]
 static bool IsMethodPresent(winrt::hstring const& typeName, winrt::hstring const& methodName);
[Windows.Foundation.Metadata.Overload("IsMethodPresent")]
public static bool IsMethodPresent(string typeName, string methodName);
function isMethodPresent(typeName, methodName)
Public Shared Function IsMethodPresent (typeName As String, methodName As String) As Boolean

Parámetros

typeName
String

Platform::String

winrt::hstring

Nombre completo del espacio de nombres del tipo.

methodName
String

Platform::String

winrt::hstring

Nombre del método.

Devoluciones

Boolean

bool

True si el método especificado está presente para el tipo; de lo contrario, false.

Atributos

Ejemplos

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

Consulte también

Se aplica a

IsMethodPresent(String, String, UInt32)

Devuelve true o false para indicar si existe una sobrecarga de método especificada con el número especificado de parámetros de entrada para un tipo especificado.

public:
 static bool IsMethodPresent(Platform::String ^ typeName, Platform::String ^ methodName, unsigned int inputParameterCount);
/// [Windows.Foundation.Metadata.Overload("IsMethodPresentWithArity")]
 static bool IsMethodPresent(winrt::hstring const& typeName, winrt::hstring const& methodName, uint32_t const& inputParameterCount);
[Windows.Foundation.Metadata.Overload("IsMethodPresentWithArity")]
public static bool IsMethodPresent(string typeName, string methodName, uint inputParameterCount);
function isMethodPresent(typeName, methodName, inputParameterCount)
Public Shared Function IsMethodPresent (typeName As String, methodName As String, inputParameterCount As UInteger) As Boolean

Parámetros

typeName
String

Platform::String

winrt::hstring

Nombre completo del espacio de nombres del tipo.

methodName
String

Platform::String

winrt::hstring

Nombre del método.

inputParameterCount
UInt32

unsigned int

uint32_t

Número de parámetros de entrada para la sobrecarga.

Devoluciones

Boolean

bool

True si el método especificado está presente para el tipo; de lo contrario, false.

Atributos

Ejemplos

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

Consulte también

Se aplica a