Dela via


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 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

Parameters

enumTypeName
String

Platform::String

winrt::hstring

The namespace-qualified name of the type.

valueName
String

Platform::String

winrt::hstring

The name of the constant.

Returns

Boolean

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

Applies to