EditorView Class
Represents a text view that supports editing within a SyntaxEditor control.
public class EditorView : TextView, IEditorView, ITextView, ITextViewTaggerProvider, IEditorViewIntelliPrompt, IEditorViewSearcher, IEditorViewTextChangeActions, ITextPositionFinder
- Inheritance:
- object Visual UIElement FrameworkElement Control ContentControl TextView object
- Implements:
- IEditorView ITextView ITextViewTaggerProvider IEditorViewIntelliPrompt IEditorViewSearcher IEditorViewTextChangeActions ITextPositionFinder
Properties
CanSplitHorizontally
Indicates whether the view can be split horizontally via a splitter.
public bool CanSplitHorizontally { get; }
Property Value
- bool:
trueif the view can be split horizontally via a splitter; otherwise,false.
ClassificationTagAggregator
The IClassificationTag aggregator for the view.
protected override ITagAggregator<IClassificationTag>? ClassificationTagAggregator { get; }
Property Value
CollapsedRegionManager
An ICollapsedRegionManager that provides information about collapsed regions in the view.
public override ICollapsedRegionManager? CollapsedRegionManager { get; }
Property Value
ContainsFocus
Indicates whether the view currently has or contains keyboard focus.
public bool ContainsFocus { get; }
Property Value
- bool:
trueif the view currently has or contains keyboard focus; otherwise,false.
Remarks
A view can contain focus if a nested control such as an adornment or search overlay pane has focus.
CurrentSnapshotLine
The current ITextSnapshotLine that the primary caret appears on within the view.
CurrentViewLine
The current ITextViewLine that the primary caret appears on within the view.
HasFocus
Indicates whether the view currently has keyboard focus.
public bool HasFocus { get; }
Property Value
- bool:
trueif the view currently has keyboard focus; otherwise,false.
HighlightedResultSearchOptions
The ISearchOptions to use for searching when highlighting search results.
public ISearchOptions? HighlightedResultSearchOptions { get; set; }
Property Value
Remarks
Highlighted results are displayed when using incremental search and the IsSearchResultHighlightingEnabled property is set to true.
This property can also be manually set when using a search pane as the user types, so that results will be immediately displayed.
Set the property to null to stop highlighting.
HighlightingStyleRegistry
The IHighlightingStyleRegistry used by this view.
public override IHighlightingStyleRegistry HighlightingStyleRegistry { get; }
Property Value
IntelliPrompt
The IEditorViewIntelliPrompt to use for requesting IntelliPrompt within the view.
IntraLineSpacerTagAggregator
The IIntraLineSpacerTag aggregator for the view.
protected override ITagAggregator<IIntraLineSpacerTag>? IntraLineSpacerTagAggregator { get; }
Property Value
IntraTextSpacerTagAggregator
The IIntraTextSpacerTag aggregator for the view.
protected override ITagAggregator<IIntraTextSpacerTag>? IntraTextSpacerTagAggregator { get; }
Property Value
IsActive
Indicates whether the view is the currently-active view in the editor.
public bool IsActive { get; }
Property Value
- bool:
trueif the view is the currently-active view in the editor; otherwise,false.
Remarks
The currently-active view in the editor is the view that contains focus when focus is moved within the editor. There is always a single view in an editor marked as active. Use the HasFocus property to determine if the view currently has keyboard focus.
IsIncrementalSearchActive
Indicates whether incremental searching is active.
public bool IsIncrementalSearchActive { get; set; }
Property Value
- bool:
trueif incremental searching is active; otherwise,false.
IsWhitespaceVisible
Indicates whether whitespace (spaces and tabs) is visible.
public override bool IsWhitespaceVisible { get; }
Property Value
- bool:
trueif whitespace (spaces and tabs) is visible; otherwise,false.
Margins
The collection of margins that are currently in the view.
OverlayPanes
The collection of IOverlayPane instances that are open in the view.
public IEditorViewOverlayPaneCollection OverlayPanes { get; }
Property Value
Placement
An EditorViewPlacement indicating the location of the view.
PositionFinder
The ITextPositionFinder that can be used to find TextPosition objects relative to another specified TextPosition.
ScrollableContentHostBounds
A System.Windows.Rect indicating the bounds of scrollable content host, relative to view coordinates.
protected override Rect ScrollableContentHostBounds { get; }
Property Value
- Rect
Searcher
The IEditorViewSearcher that is used to perform find/replace and other search-related operations on the view.
SelectedText
The text of the current primary selection range in the view.
Selection
An IEditorViewSelection that manages the selection within the view.
SelectionScopeSnapshotRange
The TextSnapshotRange in which to search for selection-based scopes.
SquiggleTagAggregator
The ISquiggleTag aggregator for the view.
protected override ITagAggregator<ISquiggleTag>? SquiggleTagAggregator { get; }
Property Value
TagTypes
The ITagType objects that are supported by the ITagger<T> objects created by this provider.
TextAreaPadding
The padding thickness around the text area content.
TextAreaSize
The size of the text area in text area coordinates.
public override Size TextAreaSize { get; }
Property Value
- Size
TextAreaViewportBounds
A System.Windows.Rect indicating the bounds of visible portion of the text area, relative to view coordinates.
public override Rect TextAreaViewportBounds { get; }
Property Value
- Rect
TextChangeActions
The IEditorViewTextChangeActions that is used to perform text change actions in the view.
public IEditorViewTextChangeActions TextChangeActions { get; }
Property Value
UnusedRegionTagAggregator
The IUnusedRegionTag aggregator for the view.
protected override ITagAggregator<IUnusedRegionTag>? UnusedRegionTagAggregator { get; }
Property Value
UseSyntaxEditorDisplayItemProperties
Indicates whether to use SyntaxEditor display item properties.
protected override bool UseSyntaxEditorDisplayItemProperties { get; }
Property Value
- bool:
trueif SyntaxEditor display item properties should be used; otherwise,false.
WordWrapMode
A WordWrapMode value indicating the type of word wrapping that is performed.
Methods
Activate()
Activates this view.
public void Activate()
Remarks
The currently-active view in the editor is the view that contains focus when focus is moved within the editor. There is always a single view in an editor marked as active.
Backspace()
Deletes the currently selected text if text is selected; otherwise, deletes the previous character.
public void Backspace()
BackspaceToPreviousWord()
Backspaces and deletes text to the beginning of the previous word.
public void BackspaceToPreviousWord()
ChangeCharacterCasing(CharacterCasing)
Changes the character casing of the selected text in the view.
public void ChangeCharacterCasing(CharacterCasing casing)
| Parameter | Type | Description |
|---|---|---|
| casing | CharacterCasing | A CharacterCasing indicating the character case to change to. |
Remarks
If no text is currently selected in the view, only the character after the caret is changed.
A casing value of CharacterCasing.Normal will capitalize the first letter of each word.
Close()
Closes the view.
protected override void Close()
CommentLines()
Comments the currently selected lines, using the ILineCommenter specified by the current ISyntaxLanguage.
public void CommentLines()
ConvertSpacesToTabs()
Converts all spaces in the selection to an equivalent number of tabs.
public void ConvertSpacesToTabs()
ConvertTabsToSpaces()
Converts all tabs in the selection to an equivalent number of spaces.
public void ConvertTabsToSpaces()
CopyAndAppendToClipboard()
Copies the currently selected text and appends it to the existing text on the clipboard.
public void CopyAndAppendToClipboard()
CopyToClipboard()
Copies the currently selected text to the clipboard.
public void CopyToClipboard()
CreateTagAggregator<T>()
Creates a new ITagAggregator<T> that collects the tag results from all ITagger<T> instances associated with this view.
public override ITagAggregator<T> CreateTagAggregator<T>() where T : ITag
- Type Parameters:
-
T-The type of ITag associated with this aggregator.
Returns
CutAndAppendToClipboard()
Cuts the currently selected text and appends it to the existing text on the clipboard.
public void CutAndAppendToClipboard()
CutLineToClipboard()
Cuts the currently active view line to the clipboard.
public void CutLineToClipboard()
CutToClipboard()
Cuts the currently selected text to the clipboard.
public void CutToClipboard()
Delete()
Deletes the currently selected text if text is selected; otherwise, deletes the next character.
public void Delete()
DeleteBlankLines()
Deletes the blank lines in the selected text, or the current view line if no text is selected and it is blank.
public void DeleteBlankLines()
Remarks
If there is no selection and the current line is not blank, any blank view lines immediately before the current view line will be deleted.
DeleteHorizontalWhitespace()
Deletes the horizontal whitespace within the current selection.
public void DeleteHorizontalWhitespace()
DeleteLine()
Deletes the currently active view line.
public void DeleteLine()
DeleteSelectedText(ITextChangeType, IEditorViewTextChangeOptions?)
Performs a delete text change by deleting the view's selected text ranges.
public bool DeleteSelectedText(ITextChangeType type, IEditorViewTextChangeOptions? options = null)
| Parameter | Type | Description |
|---|---|---|
| type | ITextChangeType | An ITextChangeType specifying the type of change. |
| options | IEditorViewTextChangeOptions | The optional IEditorViewTextChangeOptions for the change. |
Returns
- bool:
trueif a text change was allowed to occur; otherwise,false.
DeleteToLineEnd()
Deletes the currently selected text through to the end of the current view line.
public void DeleteToLineEnd()
DeleteToLineStart()
Deletes the currently selected text through to the start of the current view line.
public void DeleteToLineStart()
DeleteToNextWord()
Deletes text to the beginning of the next word.
public void DeleteToNextWord()
Duplicate()
Duplicates the current document line if there is no selection, or the selected text if there is a selection.
public void Duplicate()
ExecuteEditAction(IEditAction)
Executes the specified IEditAction within the view and records the action within a macro when appropriate.
public bool ExecuteEditAction(IEditAction action)
| Parameter | Type | Description |
|---|---|---|
| action | IEditAction | The IEditAction to execute. |
Returns
- bool:
trueif the action was able to execute; otherwise,false.
ExportSelectedText(ITextExporter)
Exports the selected text to another text format, such as HTML or RTF.
public string ExportSelectedText(ITextExporter exporter)
| Parameter | Type | Description |
|---|---|---|
| exporter | ITextExporter | The ITextExporter to use for the export operation. |
Returns
- string:
The exported text.
FindAll(IEditorSearchOptions)
Performs a find all operation.
public ISearchResultSet FindAll(IEditorSearchOptions options)
| Parameter | Type | Description |
|---|---|---|
| options | IEditorSearchOptions | The IEditorSearchOptions to use. |
Returns
- ISearchResultSet:
An ISearchResultSet that specifies the result of the operation.
FindCurrentOrNext(IEditorSearchOptions)
Performs a find next operation that can possibly match at the current caret offset.
public ISearchResultSet FindCurrentOrNext(IEditorSearchOptions options)
| Parameter | Type | Description |
|---|---|---|
| options | IEditorSearchOptions | The IEditorSearchOptions to use. |
Returns
- ISearchResultSet:
An ISearchResultSet that specifies the result of the operation.
FindCurrentWordEnd()
Returns the document offset of the word end character that occurs at or after the primary caret.
FindCurrentWordStart()
Returns the document offset of the word start character that occurs at or before the primary caret.
FindNext(IEditorSearchOptions)
Performs a find next operation.
public ISearchResultSet FindNext(IEditorSearchOptions options)
| Parameter | Type | Description |
|---|---|---|
| options | IEditorSearchOptions | The IEditorSearchOptions to use. |
Returns
- ISearchResultSet:
A ISearchResultSet that specifies the result of the operation.
FindNextIncremental(bool)
Performs an incremental search find next operation.
public ISearchResultSet FindNextIncremental(bool searchUp)
| Parameter | Type | Description |
|---|---|---|
| searchUp | bool | Whether to search upwards. |
Returns
- ISearchResultSet:
A ISearchResultSet that specifies the result of the operation.
FindNextWordStart()
Returns the document offset of the word start character that occurs after the primary caret.
FindPreviousWordStart()
Returns the document offset of the word start character that occurs before the primary caret.
Focus(FocusState)
Ensures the view has focus.
public bool Focus(FocusState state)
| Parameter | Type | Description |
|---|---|---|
| state | FocusState | A FocusState specifying the reason for focus to be set. |
Returns
- bool:
trueif focus was successfully set; otherwise,false.
FormatDocument()
Formats the entire document, using the ILineCommenter specified by the current ISyntaxLanguage..
public void FormatDocument()
FormatSelection()
Formats the currently selected lines, using the ITextFormatter specified by the current ISyntaxLanguage..
public void FormatSelection()
GetAdornmentLayer(AdornmentLayerDefinition)
Returns an IAdornmentLayer for the view with the specified definition.
public override IAdornmentLayer GetAdornmentLayer(AdornmentLayerDefinition layerDefinition)
| Parameter | Type | Description |
|---|---|---|
| layerDefinition | AdornmentLayerDefinition | The layer definition. |
Returns
Remarks
If no IAdornmentLayer already exists with the specified name, one is created.
GetCharacterBounds(TextPosition)
Returns the TextBounds for the specified TextPosition, relative to the text area's coordinates, if any.
public TextBounds? GetCharacterBounds(TextPosition position)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The TextPosition whose bounds need to be retrieved. |
Returns
GetCharacterBounds(int, bool)
Returns the TextBounds for the specified offset, relative to the text area's coordinates, if any.
public TextBounds? GetCharacterBounds(int offset, bool hasFarAffinity = false)
| Parameter | Type | Description |
|---|---|---|
| offset | int | The offset whose bounds need to be retrieved. |
| hasFarAffinity | bool | Whether the offset has affinity for the far side, which is used when the offset is where a view line is wrapped to a second view line.
The default value is |
Returns
GetCharacterColumn(TextPosition)
Returns the column index within the view for the specified TextPosition or 0 if the position is out of range.
public int GetCharacterColumn(TextPosition position)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The TextPosition whose column index is being requested. |
Returns
GetCharacterColumn(int, bool)
Returns the column index within the view for the specified offset or 0 if the offset is out of range.
public int GetCharacterColumn(int offset, bool hasFarAffinity = false)
| Parameter | Type | Description |
|---|---|---|
| offset | int | The offset whose column index is being requested. |
| hasFarAffinity | bool | Whether the offset has affinity for the far side, which is used when the offset is where a view line is wrapped to a second view line.
The default value is |
Returns
GetCharacterIndexRanges(TextPositionRange, int)
Returns the collection of character index Range objects for characters contained on each view line in the specified TextPositionRange.
public IList<Range> GetCharacterIndexRanges(TextPositionRange positionRange, int minimumLines = 1)
| Parameter | Type | Description |
|---|---|---|
| positionRange | TextPositionRange | The TextPositionRange to examine. |
| minimumLines | int | The optional minimum number of lines to return, used for block selections.
For continuous stream selections, pass |
Returns
GetCurrentWordText()
Returns the text of the current word.
GetCurrentWordTextRange()
Returns the TextRange for the current word.
GetPositionForCharacterDelta(TextPosition, int, bool, bool)
Returns the TextPosition that is relative to the specified TextPosition by a number of visible characters.
public TextPosition GetPositionForCharacterDelta(TextPosition position, int characterDelta, bool wrapAtLineTerminators, bool forceVirtualSpace)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The start TextPosition from which to search. |
| characterDelta | int | The number of visible characters (can be negative) relative to the start TextPosition that should be traversed to find the result. |
| wrapAtLineTerminators | bool | Whether to wrap to the next/previous view line when a line terminator is encountered. |
| forceVirtualSpace | bool | Whether to force virtual space to be used (for block selections). |
Returns
GetPositionForLineDelta(TextPosition, int, double?, bool)
Returns the TextPosition that is relative to the specified TextPosition by a number of visible view lines.
public TextPosition GetPositionForLineDelta(TextPosition position, int lineDelta, double? preferredHorizontalLocation, bool forceVirtualSpace)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The start TextPosition from which to search. |
| lineDelta | int | The number of visible view lines (can be negative) relative to the start TextPosition that should be traversed to find the result. |
| preferredHorizontalLocation | double? | The preferred horizontal location, if known. |
| forceVirtualSpace | bool | Whether to force virtual space to be used (for block selections). |
Returns
GetPositionForLineEnd(TextPosition)
Returns the TextPosition for the end of the view line upon which the specified TextPosition falls.
public TextPosition GetPositionForLineEnd(TextPosition position)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The start TextPosition from which to search. |
Returns
GetPositionForLineStart(TextPosition)
Returns the TextPosition for the start of the view line upon which the specified TextPosition falls.
public TextPosition GetPositionForLineStart(TextPosition position)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The start TextPosition from which to search. |
Returns
GetReader()
Returns an ITextSnapshotReader, initialized at the caret offset, that can be used to navigate through the text and token contents of the current snapshot.
GetTagger<T>(ITextView)
Returns an ITagger<T> for the specified ITextView.
public ITagger<T>? GetTagger<T>(ITextView view) where T : ITag
- Type Parameters:
-
T-The type of ITag created by the tagger.
| Parameter | Type | Description |
|---|---|---|
| view | ITextView | The ITextView that requires an ITagger<T>. |
Returns
- ITagger<T>:
An ITagger<T> for the specified ITextView.
GetTextStatisticsForSelectedText()
Returns the ITextStatistics for the selected text in the view, which provides numerous statistics about the text such as word, sentence, character counts as well as readability scores.
GetViewLine(double, LocationToPositionAlgorithm)
Returns the ITextViewLine that contains the specified Y location, if any.
public ITextViewLine? GetViewLine(double verticalLocation, LocationToPositionAlgorithm algorithm)
| Parameter | Type | Description |
|---|---|---|
| verticalLocation | double | The Y location to examine, in text area-relative coordinates. |
| algorithm | LocationToPositionAlgorithm | The LocationToPositionAlgorithm to use for calculation. |
Returns
GetVirtualCharacterFillString(TextPosition, bool)
Returns a string specifying the indentation (tabs and/or spaces) needed to fill a view line up to the specified TextPosition.
public string GetVirtualCharacterFillString(TextPosition position, bool returnCharacterFill)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The TextPosition to be examined. |
| returnCharacterFill | bool | Whether to return a character fill in addition to line fill. |
Returns
Remarks
This method will return Empty if the character is not a virtual character.
Indent()
Indents the currently selected lines.
public void Indent()
InsertFile(string)
Inserts the text contents of the specified file into the view, replacing any selected text.
public void InsertFile(string path)
| Parameter | Type | Description |
|---|---|---|
| path | string | The fully qualified path to the file that will be inserted. |
InsertLineBreak()
Inserts a line break into the current selection ranges.
public void InsertLineBreak()
InsertSurroundingText(ITextChangeType, string?, string, bool)
Inserts text into the document that surrounds the currently selected text ranges in the view.
public bool InsertSurroundingText(ITextChangeType type, string? preText, string postText, bool reselect = false)
| Parameter | Type | Description |
|---|---|---|
| type | ITextChangeType | An ITextChangeType specifying the type of change. |
| preText | string | The text to insert before the currently selected text ranges. |
| postText | string | The text to insert after the currently selected text ranges. |
| reselect | bool | Whether to reselect the inner text. |
Returns
- bool:
trueif a text change was allowed to occur; otherwise,false.
InsertSurroundingText(string?, string)
Inserts text into the document that surrounds the currently selected text ranges in the view, using a TextChangeTypes.TextReplacement change type.
public bool InsertSurroundingText(string? preText, string postText)
| Parameter | Type | Description |
|---|---|---|
| preText | string | The text to insert before the currently selected text ranges. |
| postText | string | The text to insert after the currently selected text ranges. |
Returns
- bool:
trueif a text change was allowed to occur; otherwise,false.
IsVirtualCharacter(TextPosition, bool)
Returns whether the specified TextPosition is a virtual character (beyond line or document end).
public bool IsVirtualCharacter(TextPosition position, bool lineTerminatorsAreVirtual)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The TextPosition to examine. |
| lineTerminatorsAreVirtual | bool | Indicates whether to treat line terminators as virtual characters. |
Returns
- bool:
trueif the specified TextPosition is a virtual character (beyond line or document end); otherwise,false.
IsVirtualLine(TextPosition)
Returns whether the specified TextPosition is a virtual line (beyond document end).
public bool IsVirtualLine(TextPosition position)
| Parameter | Type | Description |
|---|---|---|
| position | TextPosition | The TextPosition to examine. |
Returns
- bool:
trueif the specified TextPosition is a virtual line (beyond document end); otherwise,false.
IsVirtualLine(int)
Returns whether the specified TextPosition line index is a virtual line (beyond document end).
public bool IsVirtualLine(int positionLineIndex)
| Parameter | Type | Description |
|---|---|---|
| positionLineIndex | int | The TextPosition line index to examine. |
Returns
- bool:
trueif the specified TextPosition line index is a virtual line (beyond document end); otherwise,false.
LocationToPosition(Point, LocationToPositionAlgorithm)
Returns the TextPosition for the specified location.
public TextPosition? LocationToPosition(Point location, LocationToPositionAlgorithm algorithm)
| Parameter | Type | Description |
|---|---|---|
| location | Point | A |
| algorithm | LocationToPositionAlgorithm | The LocationToPositionAlgorithm to use for calculation. |
Returns
Remarks
If using an absolute algorithm and no valid TextPosition is located, null will be returned.
MoveSelectedLinesDown()
Moves the selected lines down.
public void MoveSelectedLinesDown()
MoveSelectedLinesUp()
Moves the selected lines up.
public void MoveSelectedLinesUp()
NormalizeLineTerminatorsToCRLF()
Normalizes all document line terminators to CRLF.
public void NormalizeLineTerminatorsToCRLF()
NormalizeLineTerminatorsToLF()
Normalizes all document line terminators to LF.
public void NormalizeLineTerminatorsToLF()
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnCanSplitHorizontallyPropertyChanged(bool, bool)
Occurs when the CanSplitHorizontally property is changed.
protected virtual void OnCanSplitHorizontallyPropertyChanged(bool oldValue, bool newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | bool | The old value. |
| newValue | bool | The new value. |
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
OnGotFocus(RoutedEventArgs)
Invoked whenever an unhandled GotFocus event reaches this element in its route.
protected override void OnGotFocus(RoutedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | RoutedEventArgs | The RoutedEventArgs that contains the event data. |
OnHasFocusChanged(RoutedEventArgs)
Occurs when the HasFocus property value is changed.
protected virtual void OnHasFocusChanged(RoutedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | RoutedEventArgs | The event data. |
OnHighlightedResultSearchOptionsChanged(RoutedEventArgs)
Occurs when the HighlightedResultSearchOptions property value is changed.
protected virtual void OnHighlightedResultSearchOptionsChanged(RoutedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | RoutedEventArgs | The event data. |
OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
Invoked just before the IsKeyboardFocusWithinChanged event is raised by this element. Implement this method to add class handling for this event.
protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | DependencyPropertyChangedEventArgs | A System.Windows.DependencyPropertyChangedEventArgs that contains the event data. |
OnKeyDown(KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.KeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnKeyDown(KeyEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | KeyEventArgs | The KeyEventArgs that contains the event data. |
OnKeyUp(KeyEventArgs)
Occurs when a key is released.
protected override void OnKeyUp(KeyEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | KeyEventArgs | A KeyEventArgs that contains the event data. |
OnLostFocus(RoutedEventArgs)
Raises the LostFocus routed event by using the event data that is provided.
protected override void OnLostFocus(RoutedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | RoutedEventArgs | A RoutedEventArgs that contains event data. This event data must contain the identifier for the LostFocus event. |
OnRendered()
Occurs when rendering of the view is complete.
protected override void OnRendered()
OnScrollStatePropertyChanged(TextViewScrollState, TextViewScrollState)
Occurs when the ScrollState property is changed.
protected override void OnScrollStatePropertyChanged(TextViewScrollState oldValue, TextViewScrollState newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | TextViewScrollState | The old value. |
| newValue | TextViewScrollState | The new value. |
OnSelectionChanged(EditorViewSelectionEventArgs)
Occurs after the selection is changed.
protected virtual void OnSelectionChanged(EditorViewSelectionEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | EditorViewSelectionEventArgs | The event data. |
OnTextAreaLayout(TextViewTextAreaLayoutEventArgs)
Occurs when the layout of the lines in the text area has been updated.
protected override void OnTextAreaLayout(TextViewTextAreaLayoutEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | TextViewTextAreaLayoutEventArgs | The event data. |
OnTextInput(TextCompositionEventArgs)
Invoked when an unhandled System.Windows.Input.TextCompositionManager.TextInput attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnTextInput(TextCompositionEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | TextCompositionEventArgs | The TextCompositionEventArgs that contains the event data. |
OnZoomLevelPropertyChanged(double, double)
Occurs when the ZoomLevel property is changed.
protected override void OnZoomLevelPropertyChanged(double oldValue, double newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | double | The old value. |
| newValue | double | The new value. |
OpenLineAbove()
Inserts a new line above the current selection ranges.
public void OpenLineAbove()
OpenLineBelow()
Inserts a new line below the current selection ranges.
public void OpenLineBelow()
Outdent()
Outdents the currently selected lines.
public void Outdent()
PasteFromClipboard()
Pastes text from the clipboard into the selection.
public void PasteFromClipboard()
PasteFromClipboard(IDataObject)
Pastes text from the specified clipboard IDataObject into the selection.
public void PasteFromClipboard(IDataObject clipboardData)
| Parameter | Type | Description |
|---|---|---|
| clipboardData | IDataObject | An IDataObject containing clipboard data. |
PerformInsertTyping(string)
Simulates the typing of text, using insert mode.
public void PerformInsertTyping(string text)
| Parameter | Type | Description |
|---|---|---|
| text | string | The text that was typed. |
PerformOverwriteTyping(string)
Simulates the typing of text, using overwrite mode.
public void PerformOverwriteTyping(string text)
| Parameter | Type | Description |
|---|---|---|
| text | string | The text that was typed. |
PerformTyping(string)
Simulates the typing of text, using the current overwrite mode setting.
public void PerformTyping(string text)
| Parameter | Type | Description |
|---|---|---|
| text | string | The text that was typed. |
ReplaceAll(IEditorSearchOptions)
Performs a replace all operation.
public ISearchResultSet ReplaceAll(IEditorSearchOptions options)
| Parameter | Type | Description |
|---|---|---|
| options | IEditorSearchOptions | The IEditorSearchOptions to use. |
Returns
- ISearchResultSet:
A ISearchResultSet that specifies the result of the operation.
ReplaceNext(IEditorSearchOptions)
Performs a replace next operation.
public ISearchResultSet ReplaceNext(IEditorSearchOptions options)
| Parameter | Type | Description |
|---|---|---|
| options | IEditorSearchOptions | The IEditorSearchOptions to use. |
Returns
- ISearchResultSet:
A ISearchResultSet that specifies the result of the operation.
ReplaceSelectedText(ITextChangeType, string?, IEditorViewTextChangeOptions?)
Performs a replace text change by overwriting the view's selected text ranges.
public bool ReplaceSelectedText(ITextChangeType type, string? text, IEditorViewTextChangeOptions? options = null)
| Parameter | Type | Description |
|---|---|---|
| type | ITextChangeType | An ITextChangeType specifying the type of change. |
| text | string | The text to insert. |
| options | IEditorViewTextChangeOptions | The optional IEditorViewTextChangeOptions for the change. |
Returns
- bool:
trueif a text change was allowed to occur; otherwise,false.
RequestAutoComplete()
Performs an auto-complete if the language supports an IntelliPrompt completion session at the current offset.
public void RequestAutoComplete()
RequestCompletionSession()
Displays a completion list if the language supports an IntelliPrompt completion session at the current offset.
public void RequestCompletionSession()
RequestInsertSnippetSession()
Displays IntelliPrompt 'expansion' code snippet selection at the current offset.
public void RequestInsertSnippetSession()
RequestParameterInfoSession()
Displays IntelliPrompt parameter info based on the current context.
public void RequestParameterInfoSession()
RequestQuickInfoSession()
Displays IntelliPrompt quick info based on the current context.
public void RequestQuickInfoSession()
RequestSurroundWithSession()
Displays IntelliPrompt 'surrounds with' code snippet selection at the current offset.
public void RequestSurroundWithSession()
SetSearchStartOffset(IEditorSearchOptions?)
Sets the search start offset based on the current selection.
public void SetSearchStartOffset(IEditorSearchOptions? options)
| Parameter | Type | Description |
|---|---|---|
| options | IEditorSearchOptions | The IEditorSearchOptions to use. |
StartPointerSelection(InputPointerButtonEventArgs)
Starts a pointer selection operation during a pointer button down event.
public void StartPointerSelection(InputPointerButtonEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | InputPointerButtonEventArgs | A InputPointerButtonEventArgs that contains the event data. |
Remarks
The left or right pointer button must be pressed when this method is called. When the left button pointer selection starts, the pointer will be captured and further selection processing will be handled automatically.
TabifySelectedLines()
Converts spaces at the beginning of the active view lines to tabs.
public void TabifySelectedLines()
ToggleCharacterCasing()
Toggles, or inverts, the character casing of the selected text.
public void ToggleCharacterCasing()
Remarks
If no text is currently selected, only the character after the caret is changed.
TransformFromTextArea(Point)
Transforms the specified System.Windows.Point in text area-relative coordinates to view-relative coordinates.
public override Point TransformFromTextArea(Point location)
| Parameter | Type | Description |
|---|---|---|
| location | Point | The System.Windows.Point to transform. |
Returns
- Point:
The transformed System.Windows.Point.
TransformFromTextArea(Rect)
Transforms the specified System.Windows.Rect in text area-relative coordinates to view-relative coordinates.
public override Rect TransformFromTextArea(Rect bounds)
| Parameter | Type | Description |
|---|---|---|
| bounds | Rect | The System.Windows.Rect to transform. |
Returns
- Rect:
The transformed System.Windows.Rect.
TransformToTextArea(Point)
Transforms the specified System.Windows.Point in view-relative coordinates to text area-relative coordinates.
public override Point TransformToTextArea(Point location)
| Parameter | Type | Description |
|---|---|---|
| location | Point | The System.Windows.Point to transform. |
Returns
- Point:
The transformed System.Windows.Point.
TransformToTextArea(Rect)
Transforms the specified System.Windows.Rect in view-relative coordinates to text area-relative coordinates.
public override Rect TransformToTextArea(Rect bounds)
| Parameter | Type | Description |
|---|---|---|
| bounds | Rect | The System.Windows.Rect to transform. |
Returns
- Rect:
The transformed System.Windows.Rect.
TransposeCharacters()
Transposes the characters before and after the caret.
public void TransposeCharacters()
TransposeLines()
Transposes the current line with the next line.
public void TransposeLines()
TransposeWords()
Transposes the current word with the next word.
public void TransposeWords()
TrimAllTrailingWhitespace()
Trims the trailing whitespace off all the lines in the document.
public void TrimAllTrailingWhitespace()
TrimTrailingWhitespace()
Trims the trailing whitespace off all the lines in the selected text, or the current document line if no text is selected.
public void TrimTrailingWhitespace()
UncommentLines()
Uncomments the currently selected lines, using the ILineCommenter specified by the current ISyntaxLanguage.
public void UncommentLines()
UntabifySelectedLines()
Converts tabs at the beginning of the active view lines to spaces.
public void UntabifySelectedLines()
Events
HasFocusChanged
Occurs when the HasFocus property value is changed.
HighlightedResultSearchOptionsChanged
Occurs when the HighlightedResultSearchOptions property value is changed.
public event RoutedEventHandler? HighlightedResultSearchOptionsChanged
Event Type
SelectionChanged
Occurs after the selection is changed.
public event EventHandler<EditorViewSelectionEventArgs>? SelectionChanged
Event Type
Fields
CanSplitHorizontallyProperty
Defines the CanSplitHorizontally property.
public static readonly DependencyProperty CanSplitHorizontallyProperty
HasFocusChangedEvent
Defines the HasFocusChanged event.
public static readonly RoutedEvent HasFocusChangedEvent
HighlightedResultSearchOptionsChangedEvent
Defines the HighlightedResultSearchOptionsChanged event.
public static readonly RoutedEvent HighlightedResultSearchOptionsChangedEvent
IsActiveProperty
Defines the IsActive property.
public static readonly DependencyProperty IsActiveProperty
SelectionChangedEvent
Defines the SelectionChanged event.
public static readonly RoutedEvent SelectionChangedEvent
Inherited Members
- TextView.ClosedEvent
- TextView.MarginsDestroyedEvent
- TextView.ScrollBarUpdateRequestedEvent
- TextView.TextAreaLayoutEvent
- TextView.ScrollStateProperty
- TextView.ZoomLevelProperty
- TextView.GetViewLine(int, bool)
- TextView.GetViewLine(TextPosition)
- TextView.GetViewLine(ITextViewLine, int, bool)
- TextView.InvalidateRender()
- TextView.OffsetToPosition(int)
- TextView.PerformLayout()
- TextView.PositionToOffset(TextPosition)
- TextView.OnClosed(RoutedEventArgs)
- TextView.OnMarginsDestroyed(RoutedEventArgs)
- TextView.OnScrollBarUpdateRequested(RoutedEventArgs)
- TextView.ArePartiallyVisibleViewLinesAllowed
- TextView.CurrentSnapshot
- TextView.DefaultBackgroundColor
- TextView.DefaultCharacterWidth
- TextView.DefaultFontFamilyName
- TextView.DefaultFontSize
- TextView.DefaultFontStyle
- TextView.DefaultFontWeight
- TextView.DefaultForegroundColor
- TextView.DefaultLineHeight
- TextView.DefaultSpaceWidth
- TextView.IsDefaultBackgroundColorLight
- TextView.Properties
- TextView.RenderableTextRange
- TextView.SyntaxEditor
- TextView.UniqueId
- TextView.VisibleViewLines
- TextView.VisualElement
- TextView.WrappedLineIndentAmount
- TextView.ScrollState
- TextView.ZoomLevel
- TextView.Closed
- TextView.MarginsDestroyed
- TextView.ScrollBarUpdateRequested
- TextView.TextAreaLayout