Represents a base class that can be used to implement an IText
- Inheritance:
-
object
Visual
UIElement
Framework
Element Control ContentControl object
- Derived:
-
Editor
View
- Implements:
-
IText
View
Constructors
TextView(SyntaxEditor, ITextSnapshot)
Initializes a new instance of the TextView
class.
Parameter | Type | Description |
---|---|---|
syntaxEditor | Syntax |
The Syntax |
initialSnapshot | IText |
The initial IText |
Properties
ArePartiallyVisibleViewLinesAllowed
Gets whether partially-visible view lines are allowed, other than the first visible view line.
Property Value
- bool:
true
if partially-visible view lines are allowed; otherwise,false
.
ClassificationTagAggregator
Gets the IClassification
Property Value
- ITag
Aggregator <IClassificationTag >: The IClassification
Tag aggregator for the view.
CollapsedRegionManager
Gets an ICollapsed
Property Value
- ICollapsed
Region :Manager An ICollapsed
Region that provides information about collapsed regions in the view.Manager
CurrentSnapshot
Gets the IText
Property Value
- IText
Snapshot : The IText
Snapshot that currently is used to populate the view.
DefaultBackgroundColor
Gets the default background color.
Property Value
- Color:
The default background color.
DefaultCharacterWidth
Gets the width of an average default font character in the view.
Property Value
- double:
The width of an average default font character in the view.
DefaultFontFamilyName
Gets the default font family name.
Property Value
- string:
The default font family name.
DefaultFontSize
Gets the default font size.
Property Value
- float:
The default font size.
DefaultFontStyle
Gets or sets the default font style.
Property Value
- Font
Style : The default font style.
DefaultFontWeight
Gets or sets the default font weight.
Property Value
- Font
Weight : The default font weight.
DefaultForegroundColor
Gets the default foreground color.
Property Value
- Color:
The default foreground color.
DefaultLineHeight
Gets the default line height.
Property Value
- double:
The default line height.
DefaultSpaceWidth
Gets the width of a default font space character in the view.
Property Value
- double:
The width of a default font space character in the view.
HighlightingStyleRegistry
Gets the IHighlighting
Property Value
- IHighlighting
Style :Registry The IHighlighting
Style used by this view.Registry
IntraLineSpacerTagAggregator
Gets the IIntra
Property Value
- ITag
Aggregator <IIntraLine >:Spacer Tag The IIntra
Line aggregator for the view.Spacer Tag
IntraTextSpacerTagAggregator
Gets the IIntra
Property Value
- ITag
Aggregator <IIntraText >:Spacer Tag The IIntra
Text aggregator for the view.Spacer Tag
IsDefaultBackgroundColorLight
Gets whether the background color of the editor is light.
Property Value
- bool:
true
if the background color of the editor is light; otherwise,false
.
IsWhitespaceVisible
Gets whether whitespace (spaces and tabs) is visible.
Property Value
- bool:
true
if whitespace (spaces and tabs) is visible; otherwise,false
.
Properties
Gets the dictionary containing custom properties for this object.
Property Value
- Property
Dictionary : The dictionary containing custom properties for this object.
RenderableTextRange
Gets the text range that can be rendered.
Property Value
- Text
Range : The text range that can be rendered.
Remarks
A value of TextRange.Deleted
means no text range limitation.
ScrollState
Gets the view's current scroll state.
Property Value
- Text
View :Scroll State The view's current scroll state.
ScrollableContentHostBounds
Gets a System.Windows.Rect indicating the bounds of scrollable content host, relative to view coordinates.
Property Value
- Rect:
A System.Windows.Rect indicating the bounds of scrollable content host, relative to view coordinates.
SquiggleTagAggregator
Gets the ISquiggle
Property Value
- ITag
Aggregator <ISquiggleTag >: The ISquiggle
Tag aggregator for the view.
SyntaxEditor
Gets the Syntax
Property Value
- Syntax
Editor : The Syntax
Editor that contains the view.
TextAreaPadding
Gets the padding thickness around the text area content.
Property Value
- Thickness:
The padding thickness around the text area content.
TextAreaSize
Gets the size of the text area in text area coordinates.
Property Value
- Size:
The size of the text area in text area coordinates.
TextAreaViewportBounds
Gets a System.Windows.Rect indicating the bounds of the visible portion of the text area, relative to view coordinates.
Property Value
- Rect:
A System.Windows.Rect indicating the bounds of the visible portion of the text area, relative to view coordinates.
UniqueId
Gets the Guid that uniquely identifies the view.
UnusedRegionTagAggregator
Gets the IUnused
Property Value
- ITag
Aggregator <IUnusedRegion >:Tag The IUnused
Region aggregator for the view.Tag
UseSyntaxEditorDisplayItemProperties
Gets whether to use Syntax
Property Value
- bool:
true
if SyntaxEditor display item properties should be used; otherwise,false
.
VisibleViewLines
Gets the collection of IText
Property Value
- IText
View :Line Collection The collection of IText
View objects that are currently visible within the view.Line
Remarks
The IText
VisualElement
Gets the Framework
Property Value
- Framework
Element : The Framework
Element that represents the view.
WordWrapMode
Gets a Word
Property Value
- Word
Wrap :Mode A Word
Wrap value indicating the type of word wrapping that is performed.Mode
WrappedLineIndentAmount
Gets the number of characters to indent any wrapped lines beyond the original indent level of the primary line.
Property Value
- int:
The number of characters to indent any wrapped lines beyond the original indent level of the primary line. The default value is
2
.
Remarks
A value of 2
will indent wrapped lines to the original indent level of the primary line, plus 2
additional character widths.
A value of 0
will indent wrapped lines to the original indent level of the primary line.
A value of -1
will not indent wrapped lines at all, and will simply align them to the left edge of the view.
The indent amount may be limited or altogether disabled if there is not enough available width in the view to support proper indentation.
ZoomLevel
Gets a percentage value indicating the zoom level.
Property Value
- double:
A percentage value indicating the zoom level. The default value is
1.0
, meaning100%
.
Methods
Close()
Closes the view.
CreateTagAggregator<T>()
Creates a new ITagAggregator<T> that collects the tag results from all ITagger<T> instances associated with this view.
- Type Parameters:
-
T
-The type of ITag associated with this aggregator.
Returns
- ITag
Aggregator <T>: The ITagAggregator<T> that was created.
GetAdornmentLayer(AdornmentLayerDefinition)
Returns an IAdornment
Parameter | Type | Description |
---|---|---|
layerDefinition | Adornment |
The layer definition. |
Returns
- IAdornment
Layer : An IAdornment
Layer for the view with the specified string-based key.
Remarks
If no IAdornment
GetViewLine(TextPosition)
Returns an IText
Parameter | Type | Description |
---|---|---|
position | Text |
The Text |
Returns
- IText
View :Line An IText
View that contains the specified TextLine Position .
GetViewLine(ITextViewLine, int)
Returns the IText
Parameter | Type | Description |
---|---|---|
viewLine | IText |
The source IText |
lineDelta | int | The number of lines to traverse (can be negative). |
Returns
- IText
View :Line The IText
View that is relative to the specified ITextLine View .Line
GetViewLine(ITextViewLine, int, bool)
Returns the IText
Parameter | Type | Description |
---|---|---|
viewLine | IText |
The source IText |
lineDelta | int | The number of lines to traverse (can be negative). |
forceVirtualSpace | bool | Whether to force virtual line space to be used as needed (for block selections). |
Returns
- IText
View :Line The IText
View that is relative to the specified ITextLine View .Line
GetViewLine(int)
Returns an IText
Parameter | Type | Description |
---|---|---|
offset | int | The offset for which to retrieve an IText |
Returns
- IText
View :Line An IText
View that contains the specified offset.Line
GetViewLine(int, bool)
Returns an IText
Parameter | Type | Description |
---|---|---|
offset | int | The offset for which to retrieve an IText |
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. |
Returns
- IText
View :Line An IText
View that contains the specified offset.Line
InvalidateRender()
Invalidates and repaints the view's canvas.
OffsetToPosition(int)
Returns the Text
Parameter | Type | Description |
---|---|---|
offset | int | The offset of a character within the document. |
Returns
- Text
Position : The Text
Position that represents the specified offset within the view lines.
OnClosed(RoutedEventArgs)
Occurs when the view's margins need to be destroyed.
Parameter | Type | Description |
---|---|---|
e | Routed |
The |
OnMarginsDestroyed(RoutedEventArgs)
Occurs when the view's margins need to be destroyed.
Parameter | Type | Description |
---|---|---|
e | Routed |
The |
OnRendered()
Occurs when rendering of the view is complete.
OnScrollBarUpdateRequested(RoutedEventArgs)
Occurs when a scrollbar update is requested.
Parameter | Type | Description |
---|---|---|
e | Routed |
The |
OnScrollStatePropertyChanged(TextViewScrollState, TextViewScrollState)
Occurs when the Scroll
Parameter | Type | Description |
---|---|---|
oldValue | Text |
The old value. |
newValue | Text |
The new value. |
OnTextAreaLayout(TextViewTextAreaLayoutEventArgs)
Occurs when the layout of the lines in the text area has been updated.
Parameter | Type | Description |
---|---|---|
e | Text |
The |
OnZoomLevelPropertyChanged(double, double)
Occurs when the Zoom
PerformLayout()
Ensures that the text area is updated with arranged view lines based on the current viewport size and scroll state.
PositionToOffset(TextPosition)
Returns the offset for the specified Text
Parameter | Type | Description |
---|---|---|
position | Text |
The Text |
Returns
- int:
The offset for the specified Text
Position within the view lines.
TransformFromTextArea(Point)
Transforms the specified System.Windows.Point in text area-relative coordinates to view-relative coordinates.
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.
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.
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.
Parameter | Type | Description |
---|---|---|
bounds | Rect | The System.Windows.Rect to transform. |
Returns
- Rect:
The transformed System.Windows.Rect.
Events
Closed
Occurs when the view is closed.
Event Type
MarginsDestroyed
Occurs when the view's margins need to be destroyed.
Event Type
ScrollBarUpdateRequested
Occurs when a scrollbar update is requested.
Event Type
TextAreaLayout
Occurs when the layout of the lines in the text area has been updated.
Event Type
Fields
ClosedEvent
Identifies the Closed routed event. This field is read-only.
MarginsDestroyedEvent
Identifies the Margins
ScrollBarUpdateRequestedEvent
Identifies the Scroll
ScrollStateProperty
Identifies the Scroll
TextAreaLayoutEvent
Identifies the Text
ZoomLevelProperty
Identifies the Zoom