IRawElementProviderSimple.GetPropertyValue(Int32) Yöntem

Tanım

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

C#
public object GetPropertyValue(int propertyId);

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.

C#
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;
    }
}

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

Ürün Sürümler
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Ayrıca bkz.