ApiInformation.IsEventPresent(String, String) Método

Definição

Retorna true ou false para indicar se um evento especificado está presente para um tipo especificado.

public:
 static bool IsEventPresent(Platform::String ^ typeName, Platform::String ^ eventName);
 static bool IsEventPresent(winrt::hstring const& typeName, winrt::hstring const& eventName);
public static bool IsEventPresent(string typeName, string eventName);
function isEventPresent(typeName, eventName)
Public Shared Function IsEventPresent (typeName As String, eventName As String) As Boolean

Parâmetros

typeName
String

Platform::String

winrt::hstring

O nome qualificado do namespace do tipo.

eventName
String

Platform::String

winrt::hstring

O nome do evento.

Retornos

Boolean

bool

True se o evento especificado estiver presente para o tipo; caso contrário, false.

Exemplos

if (Windows.Foundation.Metadata.ApiInformation.IsEventPresent("Windows.Media.Core.AudioTrack", "OpenFailed"))
{
    Debug.WriteLine("Windows.Media.Core.AudioTrack.OpenFailed event found");
}
else
{
    Debug.WriteLine("Windows.Media.Core.AudioTrack.OpenFailed event NOT found");
}

Aplica-se a