Export (0) Print
Expand All

IRawElementProviderSimple.GetPropertyValue Method

Retrieves the value of a property supported by the UI Automation provider.

Namespace: System.Windows.Automation.Provider
Assembly: UIAutomationProvider (in uiautomationprovider.dll)

Object GetPropertyValue (
	int propertyId
)
Object GetPropertyValue (
	int propertyId
)
function GetPropertyValue (
	propertyId : int
) : Object
Not applicable.

Parameters

propertyId

The property identifier.

Return Value

The property value, or a a null reference (Nothing in Visual Basic) if the property is not supported by this provider, or NotSupported if it is not supported at all.

A provider should return NotSupported only if it is explicitly hiding the property value and the request is not to be passed through to other providers.

The following code example shows an implementation of GetPropertyValue for a custom button control.

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft