AutomationPeer AutomationPeer AutomationPeer AutomationPeer Class

定义

提供一个可将元素公开给 UI 自动化的基类。Provides a base class that exposes an element to UI Automation.

public ref class AutomationPeer abstract : System::Windows::Threading::DispatcherObject
public abstract class AutomationPeer : System.Windows.Threading.DispatcherObject
type AutomationPeer = class
    inherit DispatcherObject
Public MustInherit Class AutomationPeer
Inherits DispatcherObject
继承
派生

注解

UI 自动化UI Automation查询某个Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)元素的应用程序的根时,根将返回该UI 自动化UI Automation元素的对等方。When UI 自动化UI Automation queries the root of a Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) application about an element, the root returns the UI 自动化UI Automation peer for that element. 对等方还会UI 自动化UI Automation响应与其对应元素有关的查询。The peer also responds to UI 自动化UI Automation queries about its corresponding element.

构造函数

AutomationPeer() AutomationPeer() AutomationPeer() AutomationPeer()

在由派生类的构造函数调用时,它们可对基类值进行初始化。Provides initialization for base class values when they are called by the constructor of a derived class.

属性

Dispatcher Dispatcher Dispatcher Dispatcher

获取与此 Dispatcher 关联的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
EventsSource EventsSource EventsSource EventsSource

获取或设置一个 AutomationPeer,它作为来自此 AutomationPeer 的所有事件的源报告给自动化客户端。Gets or sets an AutomationPeer that is reported to the automation client as a source for all the events that come from this AutomationPeer.

IsHwndHost IsHwndHost IsHwndHost IsHwndHost

获取一个值,该值指示与此 AutomationPeer 关联的元素是否承载 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中的 hwndsGets a value that indicates whether the element that is associated with this AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF).

方法

CheckAccess() CheckAccess() CheckAccess() CheckAccess()

确定调用线程是否可以访问此 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetAcceleratorKey() GetAcceleratorKey() GetAcceleratorKey() GetAcceleratorKey()

获取与 UI 自动化UI Automation 对等方关联的元素的加速键组合。Gets the accelerator key combinations for the element that is associated with the UI 自动化UI Automation peer.

GetAcceleratorKeyCore() GetAcceleratorKeyCore() GetAcceleratorKeyCore() GetAcceleratorKeyCore()

在派生类中重写时,由 GetAcceleratorKey() 调用。When overridden in a derived class, is called by GetAcceleratorKey().

GetAccessKey() GetAccessKey() GetAccessKey() GetAccessKey()

获取与自动化对等关联的元素的访问密钥。Gets the access key for the element that is associated with the automation peer.

GetAccessKeyCore() GetAccessKeyCore() GetAccessKeyCore() GetAccessKeyCore()

在派生类中重写时,由 GetAccessKey() 调用。When overridden in a derived class, is called by GetAccessKey().

GetAutomationControlType() GetAutomationControlType() GetAutomationControlType() GetAutomationControlType()

获取与此对等 UI 自动化UI Automation 关联的元素的控件类型。Gets the control type for the element that is associated with the UI 自动化UI Automation peer.

GetAutomationControlTypeCore() GetAutomationControlTypeCore() GetAutomationControlTypeCore() GetAutomationControlTypeCore()

在派生类中重写时,由 GetAutomationControlType() 调用。When overridden in a derived class, is called by GetAutomationControlType().

GetAutomationId() GetAutomationId() GetAutomationId() GetAutomationId()

获取与自动化同级关联的元素的 AutomationIdGets the AutomationId of the element that is associated with the automation peer.

GetAutomationIdCore() GetAutomationIdCore() GetAutomationIdCore() GetAutomationIdCore()

在派生类中重写时,由 GetAutomationId() 调用。When overridden in a derived class, is called by GetAutomationId().

GetBoundingRectangle() GetBoundingRectangle() GetBoundingRectangle() GetBoundingRectangle()

获取表示与自动化同级关联的元素的屏幕坐标的 Rect 对象。Gets the Rect object that represents the screen coordinates of the element that is associated with the automation peer.

GetBoundingRectangleCore() GetBoundingRectangleCore() GetBoundingRectangleCore() GetBoundingRectangleCore()

在派生类中重写时,由 GetBoundingRectangle() 调用。When overridden in a derived class, is called by GetBoundingRectangle().

GetChildren() GetChildren() GetChildren() GetChildren()

获取在 UI 自动化树中表示为自动化对等方的直接子元素的 GetChildren() 元素的集合。Gets the collection of GetChildren() elements that are represented in the UI Automation tree as immediate child elements of the automation peer.

GetChildrenCore() GetChildrenCore() GetChildrenCore() GetChildrenCore()

在派生类中重写时,由 GetChildren() 调用。When overridden in a derived class, is called by GetChildren().

GetClassName() GetClassName() GetClassName() GetClassName()

获取与 AutomationControlType 一起使用的名称,以区分由此 AutomationPeer 表示的控件。Gets a name that is used with AutomationControlType, to differentiate the control that is represented by this AutomationPeer.

GetClassNameCore() GetClassNameCore() GetClassNameCore() GetClassNameCore()

在派生类中重写时,由 GetClassName() 调用。When overridden in a derived class, is called by GetClassName().

GetClickablePoint() GetClickablePoint() GetClickablePoint() GetClickablePoint()

获取与自动化同级相关联的元素上响应鼠标单击的 PointGets a Point on the element that is associated with the automation peer that responds to a mouse click.

GetClickablePointCore() GetClickablePointCore() GetClickablePointCore() GetClickablePointCore()

在派生类中重写时,由 GetClickablePoint() 调用。When overridden in a derived class, is called by GetClickablePoint().

GetControlledPeers() GetControlledPeers() GetControlledPeers() GetControlledPeers()

为 UI 自动化提供受此 AutomationPeer 影响或控制的元素列表。Provides UI Automation with a list of elements affected or controlled by this AutomationPeer.

GetControlledPeersCore() GetControlledPeersCore() GetControlledPeersCore() GetControlledPeersCore()

在派生类中替代时,为 UI 自动化提供受此 AutomationPeer 影响或控制的元素列表。When overridden in a derived class, provides UI Automation with a list of elements affected or controlled by this AutomationPeer.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetHelpText() GetHelpText() GetHelpText() GetHelpText()

获取描述与自动化同级关联的控件的功能的文本。Gets text that describes the functionality of the control that is associated with the automation peer.

GetHelpTextCore() GetHelpTextCore() GetHelpTextCore() GetHelpTextCore()

在派生类中重写时,由 GetHelpText() 调用。When overridden in a derived class, is called by GetHelpText().

GetHostRawElementProviderCore() GetHostRawElementProviderCore() GetHostRawElementProviderCore() GetHostRawElementProviderCore()

告知 UI 自动化UI AutomationUI 自动化UI Automation 树中何处放置由 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 元素托管的 hwndTells UI 自动化UI Automation where in the UI 自动化UI Automation tree to place the hwnd being hosted by a Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) element.

GetItemStatus() GetItemStatus() GetItemStatus() GetItemStatus()

获取可传达与此自动化同级关联的元素的可视状态的文本。Gets text that conveys the visual status of the element that is associated with this automation peer.

GetItemStatusCore() GetItemStatusCore() GetItemStatusCore() GetItemStatusCore()

在派生类中重写时,由 GetItemStatus() 调用。When overridden in a derived class, is called by GetItemStatus().

GetItemType() GetItemType() GetItemType() GetItemType()

获取一个字符串,它描述对象表示何种类型的项。Gets a string that describes what kind of item an object represents.

GetItemTypeCore() GetItemTypeCore() GetItemTypeCore() GetItemTypeCore()

在派生类中重写时,由 GetItemType() 调用。When overridden in a derived class, is called by GetItemType().

GetLabeledBy() GetLabeledBy() GetLabeledBy() GetLabeledBy()

获取以元素为目标的 LabelAutomationPeerGets the AutomationPeer for the Label that is targeted to the element.

GetLabeledByCore() GetLabeledByCore() GetLabeledByCore() GetLabeledByCore()

在派生类中重写时,由 GetLabeledBy() 调用。When overridden in a derived class, is called by GetLabeledBy().

GetLiveSetting() GetLiveSetting() GetLiveSetting() GetLiveSetting()

获取与此自动化对等关联的活动区域的通知特征。Gets the notification characteristics of a live region that is associated with this automation peer.

GetLiveSettingCore() GetLiveSettingCore() GetLiveSettingCore() GetLiveSettingCore()

在派生类中重写时,返回活动区域的通知特征。When overridden in a derived class, returns the notification characteristics of a live region. GetLiveSetting() 方法调用。Called by the GetLiveSetting() method.

GetLocalizedControlType() GetLocalizedControlType() GetLocalizedControlType() GetLocalizedControlType()

获取一个可读的本地化字符串,该字符串表示与此自动化对等方关联的控件的 AutomationControlType 值。Gets a human-readable localized string that represents the AutomationControlType value for the control that is associated with this automation peer.

GetLocalizedControlTypeCore() GetLocalizedControlTypeCore() GetLocalizedControlTypeCore() GetLocalizedControlTypeCore()

在派生类中重写时,由 GetLocalizedControlType() 调用。When overridden in a derived class, is called by GetLocalizedControlType().

GetName() GetName() GetName() GetName()

获取描述与此自动化同级关联的元素的文本。Gets text that describes the element that is associated with this automation peer.

GetNameCore() GetNameCore() GetNameCore() GetNameCore()

在派生类中重写时,由 GetName() 调用。When overridden in a derived class, is called by GetName().

GetOrientation() GetOrientation() GetOrientation() GetOrientation()

获取指示显式控件方向(如果有)的值。Gets a value that indicates the explicit control orientation, if any.

GetOrientationCore() GetOrientationCore() GetOrientationCore() GetOrientationCore()

在派生类中重写时,由 GetOrientation() 调用。When overridden in a derived class, is called by GetOrientation().

GetParent() GetParent() GetParent() GetParent()

获取作为此 AutomationPeer 的父级的 AutomationPeerGets the AutomationPeer that is the parent of this AutomationPeer.

GetPattern(PatternInterface) GetPattern(PatternInterface) GetPattern(PatternInterface) GetPattern(PatternInterface)

在派生类中重写时,获取与指定的 PatternInterface 关联的控件模式。When overridden in a derived class, gets the control pattern that is associated with the specified PatternInterface.

GetPeerFromPoint(Point) GetPeerFromPoint(Point) GetPeerFromPoint(Point) GetPeerFromPoint(Point)

从指定的点获取 AutomationPeerGets an AutomationPeer from the specified point.

GetPeerFromPointCore(Point) GetPeerFromPointCore(Point) GetPeerFromPointCore(Point) GetPeerFromPointCore(Point)

当在派生类中重写时,将由 GetPeerFromPoint(Point) 调用。When overridden in a derived class, is called from GetPeerFromPoint(Point).

GetPositionInSet() GetPositionInSet() GetPositionInSet() GetPositionInSet()

尝试获取 PositionInSet 属性的值。Attempts to get the value of the PositionInSet property.

GetPositionInSetCore() GetPositionInSetCore() GetPositionInSetCore() GetPositionInSetCore()

在派生类中替代时,为 UI 自动化提供一个从 1 开始的整数值,该值描述此元素在组或集中占据的位置。When overridden in a derived class, provides UI Automation with a one-based integer value that describes the position this element occupies in a group or set.

GetSizeOfSet() GetSizeOfSet() GetSizeOfSet() GetSizeOfSet()

尝试获取 SizeOfSet 属性的值。Attempts to get the value of the SizeOfSet property.

GetSizeOfSetCore() GetSizeOfSetCore() GetSizeOfSetCore() GetSizeOfSetCore()

在派生类中替代时,为 UI 自动化提供此元素所属的组或集的大小。When overridden in a derived class, provides UI Automation with the size of the group or set that this element belongs to.

GetType() GetType() GetType() GetType()

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

(Inherited from Object)
HasKeyboardFocus() HasKeyboardFocus() HasKeyboardFocus() HasKeyboardFocus()

获取一个值,该值指示与此自动化同级关联的元素当前是否具有键盘焦点。Gets a value that indicates whether the element that is associated with this automation peer currently has keyboard focus.

HasKeyboardFocusCore() HasKeyboardFocusCore() HasKeyboardFocusCore() HasKeyboardFocusCore()

在派生类中重写时,由 HasKeyboardFocus() 调用。When overridden in a derived class, is called by HasKeyboardFocus().

InvalidatePeer() InvalidatePeer() InvalidatePeer() InvalidatePeer()

触发对 AutomationPeer 主要属性的重新计算,如果属性已更改,则引发对自动化客户端的 PropertyChanged 通知。Triggers recalculation of the main properties of the AutomationPeer and raises the PropertyChanged notification to the Automation Client if the properties changed.

IsContentElement() IsContentElement() IsContentElement() IsContentElement()

获取一个值,该值指示与此自动化对等方关联的元素是否包含向用户显示的数据。Gets a value that indicates whether the element that is associated with this automation peer contains data that is presented to the user.

IsContentElementCore() IsContentElementCore() IsContentElementCore() IsContentElementCore()

在派生类中重写时,由 IsContentElement() 调用。When overridden in a derived class, is called by IsContentElement().

IsControlElement() IsControlElement() IsControlElement() IsControlElement()

获取一个值,该值指示用户将元素理解为交互元素,还是理解为组成 GUIGUI 中控件的逻辑结构的一部分。Gets a value that indicates whether the element is understood by the user as interactive or as contributing to the logical structure of the control in the GUIGUI.

IsControlElementCore() IsControlElementCore() IsControlElementCore() IsControlElementCore()

在派生类中重写时,由 IsControlElement() 调用。When overridden in a derived class, is called by IsControlElement().

IsEnabled() IsEnabled() IsEnabled() IsEnabled()

获取一个值,该值指示与此自动化同级关联的元素是否支持交互。Gets a value that indicates whether the element associated with this automation peer supports interaction.

IsEnabledCore() IsEnabledCore() IsEnabledCore() IsEnabledCore()

在派生类中重写时,由 IsEnabled() 调用。When overridden in a derived class, is called by IsEnabled().

IsKeyboardFocusable() IsKeyboardFocusable() IsKeyboardFocusable() IsKeyboardFocusable()

获取一个值,该值指示此元素是否可以接受键盘焦点。Gets a value that indicates whether the element can accept keyboard focus.

IsKeyboardFocusableCore() IsKeyboardFocusableCore() IsKeyboardFocusableCore() IsKeyboardFocusableCore()

在派生类中重写时,由 IsKeyboardFocusable() 调用。When overridden in a derived class, is called by IsKeyboardFocusable().

IsOffscreen() IsOffscreen() IsOffscreen() IsOffscreen()

获取一个值,该值指示元素是否不在屏幕上。Gets a value that indicates whether an element is off the screen.

IsOffscreenCore() IsOffscreenCore() IsOffscreenCore() IsOffscreenCore()

在派生类中重写时,由 IsOffscreen() 调用。When overridden in a derived class, is called by IsOffscreen().

IsPassword() IsPassword() IsPassword() IsPassword()

获取一个值,该值指示元素是否包含敏感内容。Gets a value that indicates whether the element contains sensitive content.

IsPasswordCore() IsPasswordCore() IsPasswordCore() IsPasswordCore()

在派生类中重写时,由 IsPassword() 调用。When overridden in a derived class, is called by IsPassword().

IsRequiredForForm() IsRequiredForForm() IsRequiredForForm() IsRequiredForForm()

获取一个值,该值指示是否必须在窗体中完成与此同级关联的元素。Gets a value that indicates whether the element that is associated with this peer must be completed on a form.

IsRequiredForFormCore() IsRequiredForFormCore() IsRequiredForFormCore() IsRequiredForFormCore()

在派生类中重写时,由 IsRequiredForForm() 调用。When overridden in a derived class, is called by IsRequiredForForm().

ListenerExists(AutomationEvents) ListenerExists(AutomationEvents) ListenerExists(AutomationEvents) ListenerExists(AutomationEvents)

获取一个值,该值指示 UI 自动化UI Automation是否正在侦听指定的事件。Gets a value that indicates whether UI 自动化UI Automation is listening for the specified event.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
PeerFromProvider(IRawElementProviderSimple) PeerFromProvider(IRawElementProviderSimple) PeerFromProvider(IRawElementProviderSimple) PeerFromProvider(IRawElementProviderSimple)

获取指定的 AutomationPeer 代理的 IRawElementProviderSimpleGets an AutomationPeer for the specified IRawElementProviderSimple proxy.

ProviderFromPeer(AutomationPeer) ProviderFromPeer(AutomationPeer) ProviderFromPeer(AutomationPeer) ProviderFromPeer(AutomationPeer)

获取指定的 IRawElementProviderSimpleAutomationPeerGets the IRawElementProviderSimple for the specified AutomationPeer.

RaiseAsyncContentLoadedEvent(AsyncContentLoadedEventArgs) RaiseAsyncContentLoadedEvent(AsyncContentLoadedEventArgs) RaiseAsyncContentLoadedEvent(AsyncContentLoadedEventArgs) RaiseAsyncContentLoadedEvent(AsyncContentLoadedEventArgs)

AutomationPeer 调用以引发 AsyncContentLoadedEvent 事件。Called by the AutomationPeer to raise the AsyncContentLoadedEvent event.

RaiseAutomationEvent(AutomationEvents) RaiseAutomationEvent(AutomationEvents) RaiseAutomationEvent(AutomationEvents) RaiseAutomationEvent(AutomationEvents)

引发自动化事件。Raises an automation event.

RaisePropertyChangedEvent(AutomationProperty, Object, Object) RaisePropertyChangedEvent(AutomationProperty, Object, Object) RaisePropertyChangedEvent(AutomationProperty, Object, Object) RaisePropertyChangedEvent(AutomationProperty, Object, Object)

引发事件以通知自动化客户端已更改的属性值。Raises an event to notify the automation client of a changed property value.

ResetChildrenCache() ResetChildrenCache() ResetChildrenCache() ResetChildrenCache()

通过调用 GetChildrenCore() 同步重置子元素树。Synchronously resets the tree of child elements by calling GetChildrenCore().

SetFocus() SetFocus() SetFocus() SetFocus()

对与此自动化同级关联的元素设置键盘焦点。Sets the keyboard focus on the element that is associated with this automation peer.

SetFocusCore() SetFocusCore() SetFocusCore() SetFocusCore()

在派生类中重写时,由 SetFocus() 调用。When overridden in a derived class, is called by SetFocus().

ToString() ToString() ToString() ToString()

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

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

强制调用线程具有此 DispatcherObject 的访问权限。Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

适用于

另请参阅