AutomationElement 类

定义

表示 UI 自动化树中的一个 UI 自动化元素,并包含由 UI 自动化客户端应用程序用作标识符的值。Represents a UI Automation element in the UI Automation tree, and contains values used as identifiers by UI Automation client applications.

public ref class AutomationElement sealed
public sealed class AutomationElement
type AutomationElement = class
Public NotInheritable Class AutomationElement
继承
AutomationElement

注解

AutomationElement与 (UI) 的一段用户界面相对应,无论底层实现 (如 Windows Presentation Foundation (WPF) 或 Win32) 。An AutomationElement corresponds to a piece of user interface (UI), regardless of underlying implementation (such as Windows Presentation Foundation (WPF) or Win32).

字段

AcceleratorKeyProperty

标识 AcceleratorKey 属性。Identifies the AcceleratorKey property.

AccessKeyProperty

标识 AccessKey 属性。Identifies the AccessKey property.

AsyncContentLoadedEvent

标识在异步加载内容过程中引发的事件。Identifies an event raised during asynchronous content-loading.

AutomationFocusChangedEvent

标识在已更改焦点时引发的事件。Identifies an event that is raised when the focus has changed.

AutomationIdProperty

标识 AutomationId 属性,该属性用于标识元素。Identifies the AutomationId property, which is used to identify elements.

AutomationPropertyChangedEvent

标识 property-changed 事件。Identifies a property-changed event.

BoundingRectangleProperty

标识 BoundingRectangle 属性。Identifies the BoundingRectangle property.

ClassNameProperty

标识 ClassName 属性。Identifies the ClassName property.

ClickablePointProperty

标识可单击点的属性。Identifies the clickable point property.

ControlTypeProperty

标识 ControlType 属性。Identifies the ControlType property.

CultureProperty

标识区域性属性。Identifies the culture property.

FrameworkIdProperty

标识 FrameworkId 属性。Identifies the FrameworkId property.

HasKeyboardFocusProperty

标识 HasKeyboardFocus 属性。Identifies the HasKeyboardFocus property.

HelpTextProperty

标识 HelpText 属性。Identifies the HelpText property.

IsContentElementProperty

标识 IsContentElement 属性。Identifies the IsContentElement property.

IsControlElementProperty

标识 IsControlElement 属性。Identifies the IsControlElement property.

IsDockPatternAvailableProperty

标识表示在此 DockPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the DockPattern control pattern is available on this AutomationElement.

IsEnabledProperty

标识 IsEnabled 属性,该属性指定是否启用了 (UI) 的用户界面 AutomationElementIdentifies the IsEnabled property, which specifies whether the user interface (UI) item referenced by the AutomationElement is enabled.

IsExpandCollapsePatternAvailableProperty

标识表示在此 ExpandCollapsePatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the ExpandCollapsePattern control pattern is available on this AutomationElement.

IsGridItemPatternAvailableProperty

标识表示在此 GridItemPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the GridItemPattern control pattern is available on this AutomationElement.

IsGridPatternAvailableProperty

标识表示在此 GridPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the GridPattern control pattern is available on this AutomationElement.

IsInvokePatternAvailableProperty

标识表示在此 InvokePatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the InvokePattern control pattern is available on this AutomationElement.

IsItemContainerPatternAvailableProperty

标识表示在此 ItemContainerPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the ItemContainerPattern control pattern is available on this AutomationElement.

IsKeyboardFocusableProperty

标识 IsKeyboardFocusable 属性。Identifies the IsKeyboardFocusable property.

IsMultipleViewPatternAvailableProperty

标识表示在此 MultipleViewPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the MultipleViewPattern control pattern is available on this AutomationElement.

IsOffscreenProperty

标识 IsOffscreen 属性,该属性指示用户界面 (UI) 项在屏幕上是否可见。Identifies the IsOffscreen property, which indicates whether the user interface (UI) item is visible on the screen.

IsPasswordProperty

标识 IsPassword 属性。Identifies the IsPassword property.

IsRangeValuePatternAvailableProperty

标识表示在此 RangeValuePatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the RangeValuePattern control pattern is available on this AutomationElement.

IsRequiredForFormProperty

标识 IsRequiredForForm 属性。Identifies the IsRequiredForForm property.

IsScrollItemPatternAvailableProperty

标识表示 ScrollItemPattern 控件模式对于此 AutomationElement 是否可用的属性。Identifies the property that indicates whether the ScrollItemPattern control pattern is available for this AutomationElement.

IsScrollPatternAvailableProperty

标识表示在此 ScrollPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the ScrollPattern control pattern is available on this AutomationElement.

IsSelectionItemPatternAvailableProperty

标识表示在此 SelectionItemPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the SelectionItemPattern control pattern is available on this AutomationElement.

IsSelectionPatternAvailableProperty

标识表示在此 SelectionPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the SelectionPattern control pattern is available on this AutomationElement.

IsSynchronizedInputPatternAvailableProperty

标识表示在此 SynchronizedInputPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the SynchronizedInputPattern control pattern is available on this AutomationElement.

IsTableItemPatternAvailableProperty

标识表示在此 TableItemPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the TableItemPattern control pattern is available on this AutomationElement.

IsTablePatternAvailableProperty

标识表示在此 TablePatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the TablePattern control pattern is available on this AutomationElement.

IsTextPatternAvailableProperty

标识表示在此 TextPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the TextPattern control pattern is available on this AutomationElement.

IsTogglePatternAvailableProperty

标识表示在此 TogglePatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the TogglePattern control pattern is available on this AutomationElement.

IsTransformPatternAvailableProperty

标识表示在此 TransformPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the TransformPattern control pattern is available on this AutomationElement.

IsValuePatternAvailableProperty

标识表示在此 ValuePatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the ValuePattern control pattern is available on this AutomationElement.

IsVirtualizedItemPatternAvailableProperty

标识表示在此 VirtualizedItemPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the VirtualizedItemPattern control pattern is available on this AutomationElement.

IsWindowPatternAvailableProperty

标识表示在此 WindowPatternAutomationElement 控件模式是否可用的属性。Identifies the property that indicates whether the WindowPattern control pattern is available on this AutomationElement.

ItemStatusProperty

标识 ItemStatus 属性,它指定复杂项的可视化表示形式的状态。Identifies the ItemStatus property, which specifies the status of the visual representation of a complex item.

ItemTypeProperty

标识 ItemType 属性。Identifies the ItemType property.

LabeledByProperty

标识 LabeledBy 属性,它标识与控件关联的标签。Identifies the LabeledBy property, which identifies the label associated with a control.

LayoutInvalidatedEvent

标识布局失效时引发的事件。Identifies the event that is raised when the layout is invalidated.

LocalizedControlTypeProperty

标识本地语言的 LocalizedControlType 属性。Identifies the LocalizedControlType property in the local language.

MenuClosedEvent

标识在关闭菜单时引发的事件。Identifies the event that is raised when a menu is closed.

MenuOpenedEvent

标识在打开菜单时引发的事件。Identifies the event that is raised when a menu is opened.

NameProperty

标识 Name 属性。Identifies the Name property.

NativeWindowHandleProperty

标识 NativeWindowHandle 属性。Identifies the NativeWindowHandle property.

NotSupported

指示属性不受支持。Indicates that a property is not supported.

OrientationProperty

标识 Orientation 属性。Identifies the Orientation property.

PositionInSetProperty

描述了自动化元素在一组视为同级的元素中的序号位置。Describes the ordinal location of an automation element within a set of elements that are considered to be siblings.

ProcessIdProperty

标识 ProcessId 属性。Identifies the ProcessId property.

RuntimeIdProperty

标识包含元素的运行时标识符的属性。Identifies the property that contains the runtime identifier of the element.

SizeOfSetProperty

介绍了自动化元素在视为同级的组或集中的数量。Describes the count of automation elements in a group or set that are considered to be siblings.

StructureChangedEvent

标识在 UI 自动化树结构发生更改时引发的事件。Identifies the event that is raised when the UI Automation tree structure is changed.

ToolTipClosedEvent

标识在关闭工具提示时引发的事件。Identifies the event that is raised when a tooltip is closed.

ToolTipOpenedEvent

标识在打开工具提示时引发的事件。Identifies the event that is raised when a tooltip is opened.

属性

Cached

获取此对象的缓存的 UI 自动化属性值 AutomationElementGets the cached UI Automation property values for this AutomationElement object.

CachedChildren

获取此 AutomationElement 的已缓存子元素。Gets the cached child elements of this AutomationElement.

CachedParent

获取此 AutomationElement 的已缓存父级。Gets the cached parent of this AutomationElement.

Current

获取 AutomationElement 的当前属性值。Gets the current property values of the AutomationElement.

FocusedElement

获取当前获得焦点的 AutomationElementGets the AutomationElement that currently has focus.

RootElement

获取当前桌面的根 AutomationElementGets the root AutomationElement for the current desktop.

方法

Equals(Object)

确定指定的 AutomationElement 是否具有与此 AutomationElement 相同的值。Determines whether the specified AutomationElement has the same value as this AutomationElement.

Finalize()

在垃圾回收将某一对象回收前允许该对象尝试释放资源并执行其他清理操作。Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

FindAll(TreeScope, Condition)

返回满足指定条件的全部 AutomationElement 对象。Returns all AutomationElement objects that satisfy the specified condition.

FindFirst(TreeScope, Condition)

返回与指定条件匹配的第一个子级或子代元素。Returns the first child or descendant element that matches the specified condition.

FromHandle(IntPtr)

AutomationElement为用户界面 (UI) 指定的窗口句柄引用的项检索新的对象。Retrieves a new AutomationElement object for the user interface (UI) item referenced by the specified window handle.

FromLocalProvider(IRawElementProviderSimple)

从本地 AutomationElement 实现检索新的 IRawElementProviderSimple 对象。Retrieves a new AutomationElement object from a local IRawElementProviderSimple implementation.

FromPoint(Point)

AutomationElement为用户界面 (UI) 上指定点处的用户界面检索新的对象。Retrieves a new AutomationElement object for the user interface (UI) item at specified point on the desktop.

GetCachedPattern(AutomationPattern)

从此 AutomationElement 的缓存中检索指定模式。Retrieves the specified pattern from the cache of this AutomationElement.

GetCachedPropertyValue(AutomationProperty)

从此 AutomationElement 的缓存中检索指定属性的值。Retrieves the value of the specified property from the cache of this AutomationElement. 对于目标用户界面 (UI) 元素未显式支持的属性,将返回该属性类型的相应默认值。An appropriate default value for the property type is returned for properties not explicitly supported by the target user interface (UI) element.

GetCachedPropertyValue(AutomationProperty, Boolean)

从此 AutomationElement 的缓存中检索指定属性的值,还可以选择忽略任何默认属性。Retrieves the value of the specified property from the cache of this AutomationElement, optionally ignoring any default property.

GetClickablePoint()

检索 AutomationElement 上可以单击的点。Retrieves a point on the AutomationElement that can be clicked.

GetCurrentPattern(AutomationPattern)

检索此 AutomationElement 上的指定模式对象。Retrieves the specified pattern object on this AutomationElement.

GetCurrentPropertyValue(AutomationProperty)

检索此 AutomationElement 上指定属性的值。Retrieves the value of the specified property on this AutomationElement. 对于目标用户界面 (UI) 元素未显式支持的属性,将返回该属性类型的相应默认值。An appropriate default value for the property type is returned for properties not explicitly supported by the target user interface (UI) element.

GetCurrentPropertyValue(AutomationProperty, Boolean)

检索此 AutomationElement 上指定属性的值,还可以选择忽略任何默认属性。Retrieves the value of the specified property on this AutomationElement, optionally ignoring any default property.

GetHashCode()

检索此 AutomationElement 的哈希代码。Retrieves the hash code for this AutomationElement.

GetRuntimeId()

检索分配给用户界面 (UI) 项的唯一标识符。Retrieves the unique identifier assigned to the user interface (UI) item.

GetSupportedPatterns()

检索此 AutomationElement 支持的控件模式。Retrieves the control patterns that this AutomationElement supports.

GetSupportedProperties()

检索元素支持的属性的标识符。Retrieves the identifiers of properties supported by the element.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetUpdatedCache(CacheRequest)

检索一个具有更新缓存的新 AutomationElementRetrieves a new AutomationElement with an updated cache.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
SetFocus()

将焦点设置在 AutomationElement 上。Sets focus on the AutomationElement.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
TryGetCachedPattern(AutomationPattern, Object)

从缓存中检索控件模式。Retrieves a control pattern from the cache.

TryGetClickablePoint(Point)

检索元素内一个可单击的点。Retrieves a point within the element that can be clicked.

TryGetCurrentPattern(AutomationPattern, Object)

检索一个实现控件模式的对象。Retrieves an object that implements a control pattern.

运算符

Equality(AutomationElement, AutomationElement)

返回一个值,该值指示指定的 AutomationElement 对象是否引用 (UI) 元素的相同用户界面。Returns a value indicating whether the specified AutomationElement objects refer to the same user interface (UI) element.

Inequality(AutomationElement, AutomationElement)

返回一个值,该值指示指定的 AutomationElement 对象是否引用不同的用户界面 (UI) 元素。Returns a value indicating whether the specified AutomationElement objects refer to different user interface (UI) elements.

适用于