Export (0) Print
Expand All

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)

public:
Object^ GetCachedPropertyValue(
	AutomationProperty^ property
)

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.

ExceptionCondition
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

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft