EditorViewAutomationPeer Class
Exposes EditorView type instances to UI Automation.
public class EditorViewAutomationPeer : FrameworkElementAutomationPeer
- Inheritance:
- object AutomationPeer UIElementAutomationPeer FrameworkElementAutomationPeer object
Constructors
EditorViewAutomationPeer(EditorView)
Initializes a new instance of the EditorViewAutomationPeer
class.
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.
public ITextRangeProvider DocumentRange { get; }
Property Value
- ITextRangeProvider:
A text range that encloses the main text of a document.
HorizontalScrollPercent
Gets the current horizontal scroll position.
HorizontalViewSize
Gets the current horizontal view size.
HorizontallyScrollable
Gets a value that indicates whether the control can scroll horizontally.
IsReadOnly
Gets a value that indicates whether the value of a control is read-only.
public bool IsReadOnly { get; }
Property Value
- bool:
true
if the value is read-only;false
if 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:
Single
from SupportedTextSelection.
Value
Gets the value of the control.
VerticalScrollPercent
Gets the current vertical scroll position.
VerticalViewSize
Gets the vertical view size.
Methods
GetAutomationControlTypeCore()
Gets the control type for the element that is associated with the UI Automation peer.
protected override AutomationControlType GetAutomationControlTypeCore()
Returns
- AutomationControlType:
The control type.
GetAutomationIdCore()
Gets the string that uniquely identifies the FrameworkElement
that is associated with this AutomationPeer
.
protected override string GetAutomationIdCore()
Returns
- string:
The string that uniquely identifies the
FrameworkElement
that is associated with thisAutomationPeer
.
GetClassNameCore()
Gets a name that is used with AutomationControlType
, to differentiate the control that is represented by this AutomationPeer
.
GetLocalizedControlTypeCore()
Gets a localized string that represents the AutomationControlType
value for the control that is associated with this automation peer.
GetPattern(PatternInterface)
Gets the control pattern that is associated with the specified PatternInterface.
public override object GetPattern(PatternInterface patternInterface)
Parameter | Type | Description |
---|---|---|
patternInterface | PatternInterface | A value from the PatternInterface enumeration. |
Returns
- object:
The object that implements the pattern interface;
null
if the peer does not support this interface.
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 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 |
---|---|
ArgumentNullException | If the child element is a |
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.
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. |
verticalAmount | ScrollAmount | The vertical increment specific to the control. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If a control supports |
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 |
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. |