EditorViewAutomationPeer Class
Exposes EditorView type instances to UI Automation.
public class EditorViewAutomationPeer : FrameworkElementAutomationPeer
- Inheritance:
- object AutomationPeer UIElementAutomationPeer FrameworkElementAutomationPeer object
Constructors
EditorViewAutomationPeer(EditorView)
Exposes EditorView type instances to UI Automation.
public EditorViewAutomationPeer(EditorView owner)
| Parameter | Type | Description |
|---|---|---|
| owner | EditorView | The owner element. |
Properties
DocumentRange
Gets a text range that encloses the main text of a document.
HorizontalScrollPercent
Gets the current horizontal scroll position.
public double HorizontalScrollPercent { get; }
Property Value
- double:
The horizontal scroll position as a percentage of the total content area within the control.
HorizontalViewSize
Gets the current horizontal view size.
public double HorizontalViewSize { get; }
Property Value
- double:
The horizontal size of the viewable region as a percentage of the total content area within the control.
HorizontallyScrollable
Gets a value that indicates whether the control can scroll horizontally.
public bool HorizontallyScrollable { get; }
Property Value
- bool:
trueif the control can scroll horizontally; otherwisefalse.
IsReadOnly
Gets a value that specifies whether the value of a control is read-only.
public bool IsReadOnly { get; }
Property Value
- bool:
trueif the value is read-only;falseif it can be modified.
SupportedTextSelection
Gets a value that specifies whether a text provider supports selection and, if so, the type of selection supported.
public SupportedTextSelection SupportedTextSelection { get; }
Property Value
- SupportedTextSelection:
One of the SupportedTextSelection values.
Value
Gets the value of the control.
VerticalScrollPercent
Gets the current vertical scroll position.
public double VerticalScrollPercent { get; }
Property Value
- double:
The vertical scroll position as a percentage of the total content area within the control.
VerticalViewSize
Gets the vertical view size.
public double VerticalViewSize { get; }
Property Value
- double:
The vertical size of the viewable region as a percentage of the total content area within the control.
Methods
GetAutomationControlTypeCore()
Gets the control type for the UIElement that is associated with this UIElementAutomationPeer. This method is called by GetAutomationControlType().
protected override AutomationControlType GetAutomationControlTypeCore()
Returns
- AutomationControlType:
The Custom enumeration value.
GetAutomationIdCore()
Gets the string that uniquely identifies the FrameworkElement that is associated with this FrameworkElementAutomationPeer. Called by GetAutomationId().
protected override string GetAutomationIdCore()
Returns
- string:
The automation identifier for the element associated with the FrameworkElementAutomationPeer, or Empty if there isn't an automation identifier.
GetClassNameCore()
Gets the name of the UIElement that is associated with this UIElementAutomationPeer. This method is called by GetClassName().
GetLocalizedControlTypeCore()
When overridden in a derived class, is called by GetLocalizedControlType().
GetPattern(PatternInterface)
Gets the control pattern for the UIElement that is associated with this UIElementAutomationPeer.
public override object GetPattern(PatternInterface patternInterface)
| Parameter | Type | Description |
|---|---|---|
| patternInterface | PatternInterface | A value from the enumeration. |
Returns
- object:
An object that implements the ISynchronizedInputProvider interface if
patternInterfaceis SynchronizedInput; otherwise,null.
GetSelection()
Retrieves a collection of disjoint text ranges associated with the current text selection or selections.
public ITextRangeProvider[] GetSelection()
Returns
- ITextRangeProvider[]:
A collection of disjoint text ranges.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | If the UI Automation provider does not support text selection. |
GetVisibleRanges()
Retrieves an array of disjoint text ranges from a text container where each text range begins with the first partially visible line through to the end of the last partially visible line.
public ITextRangeProvider[] GetVisibleRanges()
Returns
- ITextRangeProvider[]:
The collection of visible text ranges within the container or an empty array. A null reference (
Nothingin Visual Basic) is never returned.
RangeFromChild(IRawElementProviderSimple)
Retrieves a text range enclosing a child element such as an image, hyperlink, or other embedded object.
public ITextRangeProvider? RangeFromChild(IRawElementProviderSimple childElement)
| Parameter | Type | Description |
|---|---|---|
| childElement | IRawElementProviderSimple | The enclosed object. |
Returns
- ITextRangeProvider:
A range that spans the child element.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If the child element is a null reference ( |
RangeFromPoint(Point)
Returns the degenerate (empty) text range nearest to the specified screen coordinates.
public ITextRangeProvider RangeFromPoint(Point screenLocation)
| Parameter | Type | Description |
|---|---|---|
| screenLocation | Point | The location in screen coordinates. |
Returns
- ITextRangeProvider:
A degenerate range nearest the specified location. A null reference (
Nothingin Visual Basic) is never returned.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If a given point is outside the UI Automation element associated with the text pattern. |
Scroll(ScrollAmount, ScrollAmount)
Scrolls the visible region of the content area horizontally and vertically.
public void Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount)
| Parameter | Type | Description |
|---|---|---|
| horizontalAmount | ScrollAmount | The horizontal increment specific to the control. NoScroll should be passed in if the control cannot be scrolled in this direction. |
| verticalAmount | ScrollAmount | The vertical increment specific to the control. NoScroll should be passed in if the control cannot be scrolled in this direction. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If a control supports SmallIncrement values exclusively for horizontal or vertical scrolling but a LargeIncrement value is passed in. |
| InvalidOperationException | An attempt is made to scroll in an unsupported direction. |
SetScrollPercent(double, double)
Sets the horizontal and vertical scroll position as a percentage of the total content area within the control.
public void SetScrollPercent(double horizontalPercent, double verticalPercent)
| Parameter | Type | Description |
|---|---|---|
| horizontalPercent | double | The horizontal position as a percentage of the content area's total range. NoScroll should be passed in if the control cannot be scrolled in this direction. |
| verticalPercent | double | The vertical position as a percentage of the content area's total range. NoScroll should be passed in if the control cannot be scrolled in this direction. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | A value that cannot be converted to a double is passed in. |
| ArgumentOutOfRangeException | A value greater than 100 or less than 0 is passed in (except -1, which is equivalent to NoScroll). The HorizontalScrollPercent and VerticalScrollPercent values are normalized to either 100 percent or 0 percent. |
| InvalidOperationException | An attempt is made to scroll in an unsupported direction. |
SetValue(string)
Sets the value of a control.
public void SetValue(string value)
| Parameter | Type | Description |
|---|---|---|
| value | string | The value to set. The provider is responsible for converting the value to the appropriate data type. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | If locale-specific information is passed to a control in an incorrect format such as an incorrectly formatted date. |
| ArgumentException | If a new value cannot be converted from a string to a format the control recognizes. |
| ElementNotEnabledException | When an attempt is made to manipulate a control that is not enabled. |