ApiInformation.IsEventPresent(String, String) メソッド

定義

指定した型に対して指定したイベントが存在するかどうかを示す true または false を返します。

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

パラメーター

typeName
String

Platform::String

winrt::hstring

型の名前空間修飾名。

eventName
String

Platform::String

winrt::hstring

イベントの名前です。

戻り値

Boolean

bool

True の 場合、指定したイベントが型に対して存在します。それ以外の場合は false

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

適用対象