Class AutomationPeer
Provides a base class that exposes an automation peer for an associated class to UI Automation.
Inherited Members
Namespace: System.Windows.Automation.Peers
Assembly: OpenSilver.dll
Syntax
public abstract class AutomationPeer : DependencyObject, IDependencyObject
Constructors
| Improve this Doc View SourceAutomationPeer()
Provides initialization for base class values when they are called by the constructor of a derived class.
Declaration
protected AutomationPeer()
Properties
| Improve this Doc View SourceEventsSource
Gets or sets an AutomationPeer that is reported to the automation client as a source for all the events that come from this AutomationPeer.
Declaration
[NotImplemented]
public AutomationPeer EventsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| AutomationPeer | The AutomationPeer that is the source of events. |
Methods
| Improve this Doc View SourceGetAcceleratorKey()
Gets the accelerator key combination for the object that is associated with the UI Automation peer.
Declaration
public string GetAcceleratorKey()
Returns
| Type | Description |
|---|---|
| System.String | The accelerator key combination hint string. |
GetAcceleratorKeyCore()
When overridden in a derived class, is called by GetAcceleratorKey().
Declaration
protected abstract string GetAcceleratorKeyCore()
Returns
| Type | Description |
|---|---|
| System.String | The accelerator key. |
GetAccessKey()
Gets the access key for the object that is associated with the automation peer.
Declaration
public string GetAccessKey()
Returns
| Type | Description |
|---|---|
| System.String | The access key. |
GetAccessKeyCore()
When overridden in a derived class, is called by GetAccessKey().
Declaration
protected abstract string GetAccessKeyCore()
Returns
| Type | Description |
|---|---|
| System.String | The access key. |
GetAutomationControlType()
Gets the control type for the object that is associated with the UI Automation peer.
Declaration
public AutomationControlType GetAutomationControlType()
Returns
| Type | Description |
|---|---|
| AutomationControlType | The control type, as a value of the enumeration. |
GetAutomationControlTypeCore()
When overridden in a derived class, is called by GetAutomationControlType().
Declaration
protected abstract AutomationControlType GetAutomationControlTypeCore()
Returns
| Type | Description |
|---|---|
| AutomationControlType | The control type, as a value of the enumeration. |
GetAutomationId()
Gets the System.Windows.Automation.AutomationProperties.AutomationId of the object that is associated with the automation peer.
Declaration
public string GetAutomationId()
Returns
| Type | Description |
|---|---|
| System.String | The automation identifier. |
GetAutomationIdCore()
When overridden in a derived class, is called by GetAutomationId().
Declaration
protected abstract string GetAutomationIdCore()
Returns
| Type | Description |
|---|---|
| System.String | The automation identifier. |
GetBoundingRectangle()
Gets the Rect object that represents the screen coordinates of the element that is associated with the automation peer.
Declaration
public Rect GetBoundingRectangle()
Returns
| Type | Description |
|---|---|
| Rect | The bounding rectangle. |
GetBoundingRectangleCore()
When overridden in a derived class, is called by GetBoundingRectangle().
Declaration
protected abstract Rect GetBoundingRectangleCore()
Returns
| Type | Description |
|---|---|
| Rect | The bounding rectangle. |
GetChildren()
Gets the collection of child elements that are represented in the UI Automation tree as immediate child elements of the automation peer.
Declaration
public List<AutomationPeer> GetChildren()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<AutomationPeer> | The collection of child elements. |
GetChildrenCore()
When overridden in a derived class, is called by GetChildren().
Declaration
protected abstract List<AutomationPeer> GetChildrenCore()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<AutomationPeer> | The collection of child elements. |
GetClassName()
Gets the name of the control class that is associated with the peer.
Declaration
public string GetClassName()
Returns
| Type | Description |
|---|---|
| System.String | The class name of the associated control class. |
GetClassNameCore()
When overridden in a derived class, is called by GetClassName().
Declaration
protected abstract string GetClassNameCore()
Returns
| Type | Description |
|---|---|
| System.String | The class name of the related control class. |
GetClickablePoint()
Gets a Point on the object that is associated with the automation peer that responds to a mouse click.
Declaration
public Point GetClickablePoint()
Returns
| Type | Description |
|---|---|
| Point | A point in the clickable area of the element. |
GetClickablePointCore()
When overridden in a derived class, is called by GetClickablePoint().
Declaration
protected abstract Point GetClickablePointCore()
Returns
| Type | Description |
|---|---|
| Point | A point within the clickable area of the element. |
GetHelpText()
Gets text that describes the functionality of the control that is associated with the automation peer.
Declaration
public string GetHelpText()
Returns
| Type | Description |
|---|---|
| System.String | The help text. |
GetHelpTextCore()
When overridden in a derived class, is called by GetHelpText().
Declaration
protected abstract string GetHelpTextCore()
Returns
| Type | Description |
|---|---|
| System.String | The help text. |
GetItemStatus()
Gets text that conveys the visual status of the object that is associated with this automation peer.
Declaration
public string GetItemStatus()
Returns
| Type | Description |
|---|---|
| System.String | The item status. |
GetItemStatusCore()
When overridden in a derived class, is called by GetItemStatus().
Declaration
protected abstract string GetItemStatusCore()
Returns
| Type | Description |
|---|---|
| System.String | The item status. |
GetItemType()
Gets a string that describes what kind of item an element represents.
Declaration
public string GetItemType()
Returns
| Type | Description |
|---|---|
| System.String | The kind of item. |
GetItemTypeCore()
When overridden in a derived class, is called by GetItemType().
Declaration
protected abstract string GetItemTypeCore()
Returns
| Type | Description |
|---|---|
| System.String | The kind of item. |
GetLabeledBy()
Gets the AutomationPeer for the UIElement that is targeted to the element.
Declaration
public AutomationPeer GetLabeledBy()
Returns
| Type | Description |
|---|---|
| AutomationPeer | The AutomationPeer for the element that is targeted by the UIElement. |
GetLabeledByCore()
When overridden in a derived class, is called by GetLabeledBy().
Declaration
protected abstract AutomationPeer GetLabeledByCore()
Returns
| Type | Description |
|---|---|
| AutomationPeer | The AutomationPeer for the element that is targeted by the UIElement. |
GetLocalizedControlType()
Gets a localized string that represents the control type, for the control that is associated with this automation peer. The localized string parallels a AutomationControlType value.
Declaration
public string GetLocalizedControlType()
Returns
| Type | Description |
|---|---|
| System.String | A string that reports the localized type of the associated control. |
GetLocalizedControlTypeCore()
When overridden in a derived class, is called by GetLocalizedControlType().
Declaration
protected abstract string GetLocalizedControlTypeCore()
Returns
| Type | Description |
|---|---|
| System.String | A string that reports the localized type of the associated control. |
GetName()
Gets the value that the automation peer reports as the UI Automation Name for the associated control.
Declaration
public string GetName()
Returns
| Type | Description |
|---|---|
| System.String | The value to report as the UI Automation Name. |
GetNameCore()
When overridden in a derived class, is called by GetName().
Declaration
protected abstract string GetNameCore()
Returns
| Type | Description |
|---|---|
| System.String | The name. |
GetOrientation()
Gets a value that indicates the explicit control orientation, if any.
Declaration
public AutomationOrientation GetOrientation()
Returns
| Type | Description |
|---|---|
| AutomationOrientation | The orientation of the control as a value of the enumeration. |
GetOrientationCore()
When overridden in a derived class, is called by GetOrientation().
Declaration
protected abstract AutomationOrientation GetOrientationCore()
Returns
| Type | Description |
|---|---|
| AutomationOrientation | The orientation of the control. |
GetParent()
Gets the AutomationPeer that is the parent of this AutomationPeer.
Declaration
public AutomationPeer GetParent()
Returns
| Type | Description |
|---|---|
| AutomationPeer | The parent automation peer. |
GetPattern(PatternInterface)
When overridden in a derived class, gets an object that supports the requested pattern, based on PatternInterface input and the peer's implementation of known patterns.
Declaration
public abstract object GetPattern(PatternInterface patternInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| PatternInterface | patternInterface | A value from the PatternInterface enumeration. |
Returns
| Type | Description |
|---|---|
| System.Object | The object that implements the pattern interface; null if this peer does not support this interface. |
HasKeyboardFocus()
Gets a value that indicates whether the object that is associated with this automation peer currently has keyboard focus.
Declaration
public bool HasKeyboardFocus()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element has keyboard focus; otherwise, false. |
HasKeyboardFocusCore()
When overridden in a derived class, is called by HasKeyboardFocus().
Declaration
protected abstract bool HasKeyboardFocusCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element has keyboard focus; otherwise, false. |
InvalidatePeer()
Triggers recalculation of the main properties of the AutomationPeer and raises the System.ComponentModel.INotifyPropertyChanged.PropertyChanged notification to the automation client if the properties have changed.
Declaration
[NotImplemented]
public void InvalidatePeer()
IsContentElement()
Gets a value that indicates whether the object that is associated with this automation peer contains data that is presented to the user.
Declaration
public bool IsContentElement()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element is a content element; otherwise, false. |
IsContentElementCore()
When overridden in a derived class, is called by IsContentElement().
Declaration
protected abstract bool IsContentElementCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element is a content element; otherwise, false. |
IsControlElement()
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 GUI.
Declaration
public bool IsControlElement()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element is a control; otherwise, false. |
IsControlElementCore()
When overridden in a derived class, is called by IsControlElement().
Declaration
protected abstract bool IsControlElementCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element is a control; otherwise, false. |
IsEnabled()
Gets a value that indicates whether the element associated with this automation peer supports interaction.
Declaration
public bool IsEnabled()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element supports interaction; otherwise, false. |
IsEnabledCore()
When overridden in a derived class, is called by IsEnabled().
Declaration
protected abstract bool IsEnabledCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the automation peer can receive and send events; otherwise, false. |
IsKeyboardFocusable()
Gets a value that indicates whether the element can accept keyboard focus.
Declaration
public bool IsKeyboardFocusable()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element can accept keyboard focus; otherwise, false. |
IsKeyboardFocusableCore()
When overridden in a derived class, is called by IsKeyboardFocusable().
Declaration
protected abstract bool IsKeyboardFocusableCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element can accept keyboard focus; otherwise, false. |
IsOffscreen()
Gets a value that indicates whether an element is off the screen.
Declaration
public bool IsOffscreen()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element is not on the screen; otherwise, false. |
IsOffscreenCore()
When overridden in a derived class, is called by IsOffscreen().
Declaration
protected abstract bool IsOffscreenCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element is not on the screen; otherwise, false. |
IsPassword()
Gets a value that indicates whether the element contains sensitive content.
Declaration
public bool IsPassword()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element contains sensitive content such as a password; otherwise, false. |
IsPasswordCore()
When overridden in a derived class, is called by IsPassword().
Declaration
protected abstract bool IsPasswordCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element contains sensitive content; otherwise, false. |
IsRequiredForForm()
Gets a value that indicates whether the object that is associated with this peer must be completed on a form.
Declaration
public bool IsRequiredForForm()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element must be completed; otherwise, false. |
IsRequiredForFormCore()
When overridden in a derived class, is called by IsRequiredForForm().
Declaration
protected abstract bool IsRequiredForFormCore()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the element must be completed; otherwise, false. |
ListenerExists(AutomationEvents)
Gets a value that indicates whether UI Automation is listening for the specified event.
Declaration
[NotImplemented]
public static bool ListenerExists(AutomationEvents eventId)
Parameters
| Type | Name | Description |
|---|---|---|
| AutomationEvents | eventId | One of the enumeration values. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if UI Automation is listening for the specified event; otherwise, false. |
PeerFromProvider(IRawElementProviderSimple)
Gets an AutomationPeer for the specified IRawElementProviderSimple proxy.
Declaration
protected AutomationPeer PeerFromProvider(IRawElementProviderSimple provider)
Parameters
| Type | Name | Description |
|---|---|---|
| IRawElementProviderSimple | provider | The class that implements IRawElementProviderSimple. |
Returns
| Type | Description |
|---|---|
| AutomationPeer | The AutomationPeer for the specified IRawElementProviderSimple proxy. |
ProviderFromPeer(AutomationPeer)
Gets the IRawElementProviderSimple proxy for the specified AutomationPeer.
Declaration
protected IRawElementProviderSimple ProviderFromPeer(AutomationPeer peer)
Parameters
| Type | Name | Description |
|---|---|---|
| AutomationPeer | peer | The automation peer. |
Returns
| Type | Description |
|---|---|
| IRawElementProviderSimple | The proxy. |
RaiseAutomationEvent(AutomationEvents)
Raises an automation event.
Declaration
[NotImplemented]
public void RaiseAutomationEvent(AutomationEvents eventId)
Parameters
| Type | Name | Description |
|---|---|---|
| AutomationEvents | eventId | The event identifier for the event to raise, as a value of the enumeration. See AutomationEvents. |
RaisePropertyChangedEvent(AutomationProperty, Object, Object)
Raises an event to notify the automation client of a changed property value.
Declaration
[NotImplemented]
public void RaisePropertyChangedEvent(AutomationProperty property, object oldValue, object newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| AutomationProperty | property | The property that changed. |
| System.Object | oldValue | The previous value of the property. |
| System.Object | newValue | The new value of the property. |
SetFocus()
Sets the keyboard focus on the object that is associated with this automation peer.
Declaration
public void SetFocus()
SetFocusCore()
When overridden in a derived class, is called by SetFocus().
Declaration
protected abstract void SetFocusCore()