ApiInformation.IsEnumNamedValuePresent(String, String) ApiInformation.IsEnumNamedValuePresent(String, String) ApiInformation.IsEnumNamedValuePresent(String, String) ApiInformation.IsEnumNamedValuePresent(String, String) ApiInformation.IsEnumNamedValuePresent(String, String) Method

Definition

Returns true or false to indicate whether a specified named constant is present for a specified enumeration.

public : static Platform::Boolean IsEnumNamedValuePresent(Platform::String enumTypeName, Platform::String valueName)
static bool IsEnumNamedValuePresent(winrt::hstring enumTypeName, winrt::hstring valueName) const;
public static bool IsEnumNamedValuePresent(String enumTypeName, String valueName)
Public Shared Function IsEnumNamedValuePresent(enumTypeName As String, valueName As String) As bool
var bool = Windows.Foundation.Metadata.ApiInformation.isEnumNamedValuePresent(enumTypeName, valueName);

Parameters

enumTypeName
String String String

The namespace-qualified name of the type.

valueName
String String String

The name of the constant.

Returns

bool bool bool

True if the specified constant is present; otherwise, false.

Examples

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