AutomationElement::GetCachedPattern Method (AutomationPattern^)

 

Retrieves the specified pattern from the cache of this AutomationElement.

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

public:
Object^ GetCachedPattern(
	AutomationPattern^ pattern
)

Parameters

pattern
Type: System.Windows.Automation::AutomationPattern^

The identifier of the pattern to retrieve.

Return Value

Type: System::Object^

An object representing the specified pattern. If there are no matching patterns, null is returned.

Exception Condition
InvalidOperationException

The requested pattern is not in the cache or is not supported by the element.

ElementNotAvailableException

The UI for the AutomationElement no longer exists.

GetCachedPattern retrieves the specified pattern from the cache. To retrieve the current object for the specified pattern, call GetCurrentPattern.

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

The following example shows how to cache and retrieve a pattern.

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

.NET Framework
Available since 3.0
Return to top
Show: