AutomationElement.Current 속성

정의

AutomationElement의 현재 속성 값을 가져옵니다.

public:
 property System::Windows::Automation::AutomationElement::AutomationElementInformation Current { System::Windows::Automation::AutomationElement::AutomationElementInformation get(); };
public System.Windows.Automation.AutomationElement.AutomationElementInformation Current { get; }
member this.Current : System.Windows.Automation.AutomationElement.AutomationElementInformation
Public ReadOnly Property Current As AutomationElement.AutomationElementInformation

속성 값

AutomationElement.AutomationElementInformation

현재 속성 값이 들어 있는 구조체입니다.

예외

AutomationElement에 대한 UI가 더 이상 존재하지 않습니다.

예제

다음 예제와 방법을 Current 속성 목록에서 선택 된 항목의 이름을 검색 하는 데 사용 됩니다.

/// <summary>
/// Handles ElementSelected events by showing a message.
/// </summary>
/// <param name="src">Object that raised the event; in this case, a list item.</param>
/// <param name="e">Event arguments.</param>
private void OnSelect(object src, AutomationEventArgs e)
{
    // Get the name of the item, which is equivalent to its text.
    AutomationElement element = src as AutomationElement;
    if (element != null)
    {
        Console.WriteLine(element.Current.Name + " was selected.");
    }
}
''' <summary>
''' Handles ElementSelected events by showing a message.
''' </summary>
''' <param name="src">Object that raised the event; in this case, a list item.</param>
''' <param name="e">Event arguments.</param>
Private Sub OnSelect(ByVal src As Object, ByVal e As AutomationEventArgs)
    ' Get the name of the item, which is equivalent to its text.
    Dim element As AutomationElement = DirectCast(src, AutomationElement)
    If (element IsNot Nothing) Then
        Console.WriteLine(element.Current.Name + " was selected.")
    End If

End Sub

설명

UI 자동화 속성에 대한 접근자는 반환된 구조Current체의 속성으로 표시됩니다. 구조를 검색할 필요가 없습니다. 아래 예제와 같이 해당 멤버에 직접 액세스할 수 있습니다. 사용 가능한 속성 및 해당 용도에 대 한 자세한 내용은 참조 하세요. AutomationElement.AutomationElementInformation합니다.

이 요소에서 UI 자동화 속성의 캐시된 값을 얻으려면 속성을 사용합니다Cached.

적용 대상

추가 정보