Export (0) Print
Expand All
Expand Minimize

AutomationElementMode Enumeration

Contains values that specify the type of reference to use when returning UI Automation elements. These values are used in the CacheRequest.AutomationElementMode property.

Namespace: System.Windows.Automation
Assembly: UIAutomationClient (in uiautomationclient.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public enum AutomationElementMode
public enum AutomationElementMode
public enum AutomationElementMode

 Member nameDescription
FullSpecifies that returned elements have a full reference to the underlying UI.  
NoneSpecifies that returned elements have no reference to the underlying UI and contain only cached information. This mode might be used, for example, to retrieve the names of items in a list box without obtaining references to the items themselves. 

Full is the default, and specifies that returned elements contain a full reference to the underlying user interface (UI). None specifies that the returned elements have no reference to the underlying UI, and contain only cached information.

Certain operations on elements, such as GetCurrentPropertyValue or SetFocus, require a full reference; attempting to perform these on an element that has none results in an InvalidOperationException.

Using None can be more efficient when only properties are needed, as it avoids the overhead involved in setting up full references.

The following example shows how to set the mode on a CacheRequest.

// Set up the request.
CacheRequest cacheRequest = new CacheRequest();

// Do not get a full reference to the cached objects, only to their cached properties and patterns.
cacheRequest.AutomationElementMode = AutomationElementMode.None;

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:
© 2014 Microsoft