ApiInformation.IsEventPresent(String, String) Méthode

Définition

Retourne true ou false pour indiquer si un événement spécifié est présent pour un type spécifié.

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

Paramètres

typeName
String

Platform::String

winrt::hstring

Nom qualifié d’espace de noms du type.

eventName
String

Platform::String

winrt::hstring

Nom de l’événement.

Retours

Boolean

bool

True si l’événement spécifié est présent pour le type ; sinon, false.

Exemples

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

S’applique à