ApiInformation.IsEnumNamedValuePresent(String, String) Methode

Definition

Gibt true oder false zurück, um anzugeben, ob eine angegebene benannte Konstante für eine angegebene Enumeration vorhanden ist.

public:
 static bool IsEnumNamedValuePresent(Platform::String ^ enumTypeName, Platform::String ^ valueName);
 static bool IsEnumNamedValuePresent(winrt::hstring const& enumTypeName, winrt::hstring const& valueName);
public static bool IsEnumNamedValuePresent(string enumTypeName, string valueName);
function isEnumNamedValuePresent(enumTypeName, valueName)
Public Shared Function IsEnumNamedValuePresent (enumTypeName As String, valueName As String) As Boolean

Parameter

enumTypeName
String

Platform::String

winrt::hstring

Der namespacequalifizierte Name des Typs.

valueName
String

Platform::String

winrt::hstring

Der Name der Konstante.

Gibt zurück

Boolean

bool

True , wenn die angegebene Konstante vorhanden ist; andernfalls false.

Beispiele

if (Windows.Foundation.Metadata.ApiInformation.IsEnumNamedValuePresent("Windows.UI.Xaml.Automation.Peers.AutomationControlType", "ComboBox"))
{
    Debug.WriteLine("Windows.UI.Xaml.Automation.Peers.AutomationControlType.ComboBox enum value found");
}
else
{
    Debug.WriteLine("Windows.UI.Xaml.Automation.Peers.AutomationControlType.ComboBox enum value NOT found");
}

Gilt für: