AutomationElement.GetCurrentPropertyValue 메서드

정의

AutomationElement에서 지정된 속성의 현재 값을 검색합니다.

오버로드

GetCurrentPropertyValue(AutomationProperty)

AutomationElement의 지정된 속성 값을 검색합니다. 속성 형식에 대한 적절한 기본값은 대상 UI(사용자 인터페이스) 요소에서 명시적으로 지원되지 않는 속성에 대해 반환됩니다.

GetCurrentPropertyValue(AutomationProperty, Boolean)

AutomationElement에서 지정된 속성의 값을 검색하고, 기본 속성을 선택적으로 무시할 수 있습니다.

설명

반환한 값은 GetCurrentPropertyValue 메서드는 호출 시 현재 합니다. 이후에 UI(사용자 인터페이스)와 상호 작용하는 다른 애플리케이션에 의해 값이 변경됩니다.

일부 형태의 UI의 경우 이 메서드는 프로세스 간 성능 오버헤드를 발생합니다. 애플리케이션 속성을 사용 하 여 검색 한 다음 오버 헤드가 집중할 수 GetCachedPropertyValue입니다.

GetCurrentPropertyValue(AutomationProperty)

AutomationElement의 지정된 속성 값을 검색합니다. 속성 형식에 대한 적절한 기본값은 대상 UI(사용자 인터페이스) 요소에서 명시적으로 지원되지 않는 속성에 대해 반환됩니다.

public:
 System::Object ^ GetCurrentPropertyValue(System::Windows::Automation::AutomationProperty ^ property);
public object GetCurrentPropertyValue (System.Windows.Automation.AutomationProperty property);
member this.GetCurrentPropertyValue : System.Windows.Automation.AutomationProperty -> obj
Public Function GetCurrentPropertyValue (property As AutomationProperty) As Object

매개 변수

property
AutomationProperty

검색할 속성을 지정하는 UI 자동화 속성 식별자입니다.

반환

지정된 속성의 값이 들어 있는 개체입니다.

예외

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

예제

다음 예제에서는 변수의 현재 값을 검색 합니다 HelpText 속성입니다. 요소 하나를 제공 하지 않는 경우 기본값 반환 됩니다.

// elementList is an AutomationElement.
string helpString =
    elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty) as string;
' elementList is an AutomationElement.
Dim helpString As String = _
    CStr(elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty))

설명

반환한 값은 GetCurrentPropertyValue 메서드는 호출 시 현재 합니다. 이후에 UI와 상호 작용하는 다른 애플리케이션에 의해 값이 변경됩니다.

요소 자체에 대 한 UI 자동화 공급자의 속성을 지 원하는 속성의 값이 반환 됩니다. 그렇지 않으면 UI 자동화에서 지정한 기본 속성이 반환됩니다. 참조 속성 식별자 필드의 기본 속성에 대 한 내용은 AutomationElement와 같은 AcceleratorKeyProperty합니다.

일부 형태의 UI의 경우 이 메서드는 프로세스 간 성능 오버헤드를 발생합니다. 캐싱 속성 및 사용 하 여 검색 하 여 오버 헤드 전체가 대상 이지만 GetCachedPropertyValue합니다.

적용 대상

GetCurrentPropertyValue(AutomationProperty, Boolean)

AutomationElement에서 지정된 속성의 값을 검색하고, 기본 속성을 선택적으로 무시할 수 있습니다.

public:
 System::Object ^ GetCurrentPropertyValue(System::Windows::Automation::AutomationProperty ^ property, bool ignoreDefaultValue);
public object GetCurrentPropertyValue (System.Windows.Automation.AutomationProperty property, bool ignoreDefaultValue);
member this.GetCurrentPropertyValue : System.Windows.Automation.AutomationProperty * bool -> obj
Public Function GetCurrentPropertyValue (property As AutomationProperty, ignoreDefaultValue As Boolean) As Object

매개 변수

property
AutomationProperty

검색할 속성을 지정하는 UI 자동화 속성 식별자입니다.

ignoreDefaultValue
Boolean

지정된 속성이 지원되는 경우 기본값을 무시할지 여부를 지정하는 값입니다.

반환

지정된 속성의 값이 들어 있는 개체이거나, 요소에서 값을 제공하지 않고 ignoreDefaultValuetrue인 경우 NotSupported입니다.

예외

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

예제

현재 값을 검색 하는 다음 예제는 HelpText 속성을 지정 하는 요소 자체의 속성에 대 한 값을 제공 하지 않는 경우 NotSupported 대신 기본값을 반환 하는 것입니다.

// elementList is an AutomationElement.
object help = elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty, true);
if (help == AutomationElement.NotSupported)
{
    help = "No help available";
}
string helpText = (string)help;
' elementList is an AutomationElement.
Dim help As Object = elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty, True)
If help Is AutomationElement.NotSupported Then
    help = "No help available"
End If
Dim helpText As String = CStr(help)

설명

전달 falseignoreDefaultValue 호출 하는 것과 같습니다 AutomationElement.GetCurrentPropertyValue(AutomationProperty)합니다.

요소 자체에 대 한 UI 자동화 공급자의 속성을 지 원하는 속성의 값이 반환 됩니다. 그렇지 않으면 가 이falseignoreDefaultValue UI 자동화로 지정된 기본 속성이 반환됩니다. 참조 속성 식별자 필드의 기본 속성에 대 한 내용은 AutomationElement와 같은 AcceleratorKeyProperty합니다.

반환한 값은 GetCurrentPropertyValue 메서드는 호출 시 현재 합니다. 이후에 UI(사용자 인터페이스)와 상호 작용하는 다른 애플리케이션에 의해 값이 변경됩니다.

일부 형태의 UI의 경우 이 메서드는 프로세스 간 성능 오버헤드를 발생합니다. 애플리케이션 속성을 사용 하 여 검색 한 다음 오버 헤드가 집중할 수 GetCachedPropertyValue입니다.

적용 대상