Export (0) Print
Expand All

CacheRequest.Add Method (AutomationProperty)

Adds the specified AutomationProperty identifier to this CacheRequest.

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

public void Add(
	AutomationProperty property
)

Parameters

property
Type: System.Windows.Automation.AutomationProperty

An identifier specifying a property value to cache.

ExceptionCondition
InvalidOperationException

The CacheRequest is active.

When a CacheRequest is created, the RuntimeIdProperty identifier is added as a default property to cache.

Adding a property that is already in the cache request has no effect.

The following example shows how to construct a CacheRequest and add a property to be cached.

CacheRequest cacheRequest = new CacheRequest();
cacheRequest.Add(AutomationElement.NameProperty);
cacheRequest.Add(AutomationElement.IsEnabledProperty);
cacheRequest.Add(SelectionItemPattern.Pattern);
cacheRequest.Add(SelectionItemPattern.SelectionContainerProperty);

.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