IRawElementProviderSimple.GetPropertyValue(Int32) Yöntem

Tanım

UI Otomasyonu sağlayıcısı tarafından desteklenen bir özelliğin değerini alır.

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

Parametreler

propertyId
Int32

Özellik tanımlayıcısı.

Döndürülenler

Özellik değeri veya null özellik bu sağlayıcı tarafından desteklenmiyorsa veya NotSupported hiç desteklenmiyorsa.

Örnekler

Aşağıdaki kod örneği, özel düğme denetimi için uygulamasını GetPropertyValue gösterir.

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

Açıklamalar

Sağlayıcının yalnızca özellik değerini açıkça gizlemesi ve isteğin diğer sağlayıcılara geçirilmemesi durumunda döndürülmesi NotSupported gerekir.

Şunlara uygulanır

Ayrıca bkz.