IRawElementProviderSimple.GetPropertyValue(Int32) 메서드

정의

UI 자동화 공급자가 지원하는 속성 값을 검색합니다.

public:
 System::Object ^ GetPropertyValue(int propertyId);
public object GetPropertyValue (int propertyId);
abstract member GetPropertyValue : int -> obj
Public Function GetPropertyValue (propertyId As Integer) As Object

매개 변수

propertyId
Int32

속성 식별자입니다.

반환

속성 값 또는 이 공급자가 속성을 지원하지 않는 경우 null, 전혀 지원되지 않는 경우 NotSupported입니다.

예제

다음 코드 예제에서는 사용자 지정 단추 컨트롤에 대 한 구현 GetPropertyValue 을 보여 입니다.

object IRawElementProviderSimple.GetPropertyValue(int propertyId)
{
    if (propertyId == AutomationElementIdentifiers.NameProperty.Id)
    {
        return "RootButtonControl";
    }
    else if (propertyId == AutomationElementIdentifiers.ClassNameProperty.Id)
    {
        return "RootButtonControlClass";
    }
    else if (propertyId == AutomationElementIdentifiers.ControlTypeProperty.Id)
    {
        return ControlType.Button.Id;  
    }
    else if (propertyId == AutomationElementIdentifiers.IsContentElementProperty.Id)
    {
        return false;
    }
    else if (propertyId == AutomationElementIdentifiers.IsControlElementProperty.Id)
    {
        return true;
    }
    else
    {
        return null;
    }
}
Function GetPropertyValue(ByVal propertyId As Integer) As Object _
    Implements IRawElementProviderSimple.GetPropertyValue

    If propertyId = AutomationElementIdentifiers.NameProperty.Id Then
        Return "RootButtonControl"
    ElseIf propertyId = AutomationElementIdentifiers.ClassNameProperty.Id Then
        Return "RootButtonControlClass"
    ElseIf propertyId = AutomationElementIdentifiers.ControlTypeProperty.Id Then
        Return ControlType.Button.Id
    ElseIf propertyId = AutomationElementIdentifiers.IsContentElementProperty.Id Then
        Return False
    ElseIf propertyId = AutomationElementIdentifiers.IsControlElementProperty.Id Then
        Return True
    Else
        Return Nothing
    End If

End Function 'IRawElementProviderSimple.GetPropertyValue

설명

공급자는 속성 값을 명시적으로 숨기고 요청이 다른 공급자에게 전달되지 않는 경우에만 를 반환 NotSupported 해야 합니다.

적용 대상

추가 정보