ApiInformation.IsEventPresent(String, String) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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
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 à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour