PropertyConditionFlags PropertyConditionFlags PropertyConditionFlags PropertyConditionFlags Enum

정의

PropertyCondition에서 속성 값이 테스트되는 방식을 지정하는 값을 포함합니다.Contains values that specify how a property value is tested in a PropertyCondition.

이 열거형에는 멤버 값의 비트 조합을 허용하는 FlagsAttribute 특성이 있습니다.

public enum class PropertyConditionFlags
[System.Flags]
public enum PropertyConditionFlags
type PropertyConditionFlags = 
Public Enum PropertyConditionFlags
상속
PropertyConditionFlagsPropertyConditionFlagsPropertyConditionFlagsPropertyConditionFlags
특성

필드

IgnoreCase IgnoreCase IgnoreCase IgnoreCase 1

대/소문자를 구분하지 않고 문자열 속성 값을 비교하도록 지정합니다.Specifies that comparison with a string property value is not case-sensitive.

None None None None 0

기본 동작(대/소문자를 구분하며 문자열 비교)을 사용하여 속성 값을 테스트하도록 지정합니다.Specifies that the property value is tested using default behavior (case-sensitive comparison for strings).

예제

다음 예제 IgnoreCase 에서는가 System.Windows.Automation.PropertyCondition에 설정 되어 있습니다.In the following example, IgnoreCase is set in a System.Windows.Automation.PropertyCondition.

/// <summary>
/// Find a UI Automation child element by ID.
/// </summary>
/// <param name="controlName">Name of the control, such as "button1"</param>
/// <param name="parentElement">Parent element, such as an application window, or the 
/// AutomationElement.RootElement when searching for the application window.</param>
/// <returns>The UI Automation element.</returns>
private AutomationElement FindChildElement(String controlName, AutomationElement rootElement)
{
    if ((controlName == "") || (rootElement == null))
    {
        throw new ArgumentException("Argument cannot be null or empty.");
    }
    // Set a property condition that will be used to find the main form of the
    // target application. In the case of a WinForms control, the name of the control
    // is also the AutomationId of the element representing the control.
    Condition propCondition = new PropertyCondition(
        AutomationElement.AutomationIdProperty, controlName, PropertyConditionFlags.IgnoreCase);

    // Find the element.
    return rootElement.FindFirst(TreeScope.Element | TreeScope.Children, propCondition);
}
''' <summary>
''' Find a UI Automation child element by ID.
''' </summary>
''' <param name="controlName">Name of the control, such as "button1"</param>
''' <param name="rootElement">Parent element, such as an application window, or the 
''' AutomationElement.RootElement when searching for the application window.</param>
''' <returns>The UI Automation element.</returns>
Private Function FindChildElement(ByVal controlName As String, ByVal rootElement As AutomationElement) _
    As AutomationElement
    If controlName = "" OrElse rootElement Is Nothing Then
        Throw New ArgumentException("Argument cannot be null or empty.")
    End If
    ' Set a property condition that will be used to find the main form of the
    ' target application. In the case of a WinForms control, the name of the control
    ' is also the AutomationId of the element representing the control.
    Dim propCondition As New PropertyCondition(AutomationElement.AutomationIdProperty, _
        controlName, PropertyConditionFlags.IgnoreCase)

    ' Find the element.
    Return rootElement.FindFirst(TreeScope.Element Or TreeScope.Children, propCondition)

End Function 'FindChildElement

적용 대상

추가 정보