AutomationElement.GetCachedPropertyValue Method (AutomationProperty)

 

Retrieves the value of the specified property from the cache of this AutomationElement. An appropriate default value for the property type is returned for properties not explicitly supported by the target user interface (UI) element.

Namespace:   System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

member GetCachedPropertyValue : 
        property:AutomationProperty -> Object

Parameters

property
Type: System.Windows.Automation.AutomationProperty

The identifier of the property to retrieve.

Return Value

Type: System.Object

An object containing the value of the specified property.

Exception Condition
InvalidOperationException

The requested property is not in the cache.

ElementNotAvailableException

The user interface (UI) for the AutomationElement no longer exists.

If the UI Automation provider for the element itself supports the property, the value of the property is returned. Otherwise, a default property specified by UI Automation is returned. For information on default properties, see the property identifier fields of AutomationElement, such as AcceleratorKeyProperty.

GetCachedPropertyValue retrieves the specified property from the AutomationElement's cache. To retrieve the current object for the specified property call GetCurrentPropertyValue.

This method throws an exception if the requested property was not previously cached.

The following shows how this method can be used to retrieve a cached property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: