AutomationElement.Current AutomationElement.Current AutomationElement.Current AutomationElement.Current Property

정의

AutomationElement의 현재 속성 값을 가져옵니다.Gets the current property values of the 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

속성 값

예외

예제

다음 예제와 방법을 Current 속성 목록에서 선택 된 항목의 이름을 검색 하는 데 사용 됩니다.The following example shows how the Current property is used to retrieve the name of an item that has been selected in a list.

/// <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 자동화UI Automation 속성에서 반환 된 구조체의 속성으로 표현 됩니다 Current합니다.The accessors for UI 자동화UI Automation properties are represented as properties of the structure returned by Current. 구조를 검색할 필요가 없습니다. 아래 예제와 같이 해당 멤버에 직접 액세스할 수 있습니다.You do not need to retrieve the structure; you can access its members directly, as in the example below. 사용 가능한 속성 및 해당 용도에 대 한 자세한 내용은 참조 하세요. AutomationElement.AutomationElementInformation합니다.For specific information on the properties available and their use, see AutomationElement.AutomationElementInformation.

캐시 된 값을 가져올 UI 자동화UI Automation 이 요소에 대 한 속성을 사용 합니다 Cached 속성입니다.To get the cached value of UI 자동화UI Automation properties on this element, use the Cached property.

적용 대상

추가 정보