ClassRadSyntaxEditorElement
The primary element of the RadSyntaxEditor control that provides syntax highlighting, text editing, and code visualization capabilities.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.SyntaxEditor.dll
Syntax:
public class RadSyntaxEditorElement : FrameworkElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, ISupportDrop, ITextDocumentEditor, IDisposable
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementUIElementFrameworkElementRadSyntaxEditorElement
Implements:
Inherited Members
Constructors
RadSyntaxEditorElement()
Initializes a new instance of the RadSyntaxEditorElement class with default settings for syntax highlighting and text editing.
Declaration
public RadSyntaxEditorElement()
Fields
AcceptsReturnProperty
Registers the AcceptsReturn property.
Declaration
public static readonly RadProperty AcceptsReturnProperty
Field Value
AllowScalingProperty
Registers the AllowScaling dependency property.
Declaration
public static readonly RadProperty AllowScalingProperty
Field Value
BorderColorProperty
Declaration
public static readonly RadProperty BorderColorProperty
Field Value
CaretBrushProperty
Registers the CaretBrush dependency property.
Declaration
public static readonly RadProperty CaretBrushProperty
Field Value
EditorFontFamilyProperty
Registers the EditorFontFamily dependency property.
Declaration
public static readonly RadProperty EditorFontFamilyProperty
Field Value
EditorFontSizeProperty
Registers the EditorFontSize dependency property.
Declaration
public static readonly RadProperty EditorFontSizeProperty
Field Value
EditorFontStretchProperty
Registers the dependency property.
Declaration
public static readonly RadProperty EditorFontStretchProperty
Field Value
EditorFontStyleProperty
Registers the dependency property.
Declaration
public static readonly RadProperty EditorFontStyleProperty
Field Value
EditorFontWeightProperty
Registers the dependency property.
Declaration
public static readonly RadProperty EditorFontWeightProperty
Field Value
HorizontalScrollBarVisibilityProperty
Registers the HorizontalScrollBarVisibility dependency property.
Declaration
public static readonly RadProperty HorizontalScrollBarVisibilityProperty
Field Value
IndentProviderProperty
Registers the IndentProvider property.
Declaration
public static readonly RadProperty IndentProviderProperty
Field Value
InsertModeProperty
Registers the InsertMode property.
Declaration
public static readonly RadProperty InsertModeProperty
Field Value
IsCaretVisibleProperty
Registers the IsCaretVisible dependency property.
Declaration
public static readonly RadProperty IsCaretVisibleProperty
Field Value
IsReadOnlyProperty
Registers the IsReadOnly property.
Declaration
public static readonly RadProperty IsReadOnlyProperty
Field Value
IsSelectionEnabledProperty
Registers the IsSelectionEnabled dependency property.
Declaration
public static readonly RadProperty IsSelectionEnabledProperty
Field Value
IsWordWrapEnabledProperty
Registers the IsWordWrapEnabledProperty dependency property.
Declaration
public static readonly RadProperty IsWordWrapEnabledProperty
Field Value
PaletteProperty
Registers the Palette dependency property.
Declaration
public static readonly RadProperty PaletteProperty
Field Value
ScaleFactorProperty
Registers the ScaleFactor dependency property.
Declaration
public static readonly RadProperty ScaleFactorProperty
Field Value
SelectionFillColorProperty
Declaration
public static readonly RadProperty SelectionFillColorProperty
Field Value
SelectionFillProperty
Registers the SelectionFill dependency property.
Declaration
public static readonly RadProperty SelectionFillProperty
Field Value
SelectionStrokeColorProperty
Declaration
public static readonly RadProperty SelectionStrokeColorProperty
Field Value
SelectionStrokeProperty
Registers the SelectionStroke dependency property.
Declaration
public static readonly RadProperty SelectionStrokeProperty
Field Value
ShouldTaggersProcessEntireLinesProperty
Registers the ShouldTaggersProcessEntireLinesProperty dependency property.
Declaration
public static readonly RadProperty ShouldTaggersProcessEntireLinesProperty
Field Value
ShowLineNumbersProperty
Registers the ShowLineNumbers dependency property.
Declaration
public static readonly RadProperty ShowLineNumbersProperty
Field Value
VerticalScrollBarVisibilityProperty
Registers the VerticalScrollBarVisibility dependency property.
Declaration
public static readonly RadProperty VerticalScrollBarVisibilityProperty
Field Value
Properties
AcceptsReturn
Gets or sets a value indicating whether [accepts return].
Declaration
public bool AcceptsReturn { get; set; }
Property Value
true if [accepts return]; otherwise, false.
AllowScaling
Gets or sets a value indicating whether the content of the syntax editor can be scaled (zoomed in or out).
BorderColor
Gets or sets the color of the border around the syntax editor.
Declaration
[VsbBrowsable(true)]
public Color BorderColor { get; set; }
Property Value
CaretBrush
Gets or sets the brush used to render the text cursor (caret) in the syntax editor.
CaretColor
Gets or sets the color of the text cursor (caret) in the syntax editor.
CaretDisplayMode
Gets or sets the visual style of the text cursor (caret) in the syntax editor, such as block, underline, or normal vertical line.
Declaration
public CaretDisplayMode CaretDisplayMode { get; set; }
Property Value
CaretPosition
Gets the current position of the text cursor (caret) within the document.
Declaration
public CaretPosition CaretPosition { get; }
Property Value
CaretWidth
Gets or sets the width of the text cursor (caret) in the syntax editor.
Commands
Gets the collection of available editor commands that can be executed on this syntax editor.
Declaration
public SyntaxEditorCommands Commands { get; }
Property Value
CurrentInsertMode
Gets or sets the current insert mode.
Declaration
public string CurrentInsertMode { get; set; }
Property Value
The current insert mode.
Document
Gets or sets the text document that is being displayed and edited in the syntax editor.
Declaration
public TextDocument Document { get; set; }
Property Value
Implements
EditorFontFamily
Gets or sets the font family used to render text in the syntax editor.
Declaration
public FontFamily EditorFontFamily { get; set; }
Property Value
EditorFontSize
Gets or sets the font size used to render text in the syntax editor.
EditorPresenter
Gets the presenter component responsible for rendering and displaying the text content in the syntax editor.
Declaration
public SyntaxEditorPresenter EditorPresenter { get; }
Property Value
FoldingManager
Gets the component responsible for handling code folding functionality, allowing collapsing and expanding of code regions.
Declaration
public FoldingManager FoldingManager { get; }
Property Value
HorizontalScrollBar
Gets the horizontal scroll bar element that enables scrolling through content that extends beyond the visible width of the editor.
Declaration
public RadScrollBarElement HorizontalScrollBar { get; }
Property Value
IndentProvider
Gets or sets the indent provider.
Declaration
public ISmartIndentProvider IndentProvider { get; set; }
Property Value
The indent provider.
InputHandler
Gets or sets an instance of SyntaxEditorInputBehavior that will handle user input.
Declaration
public SyntaxEditorInputBehavior InputHandler { get; set; }
Property Value
IntelliPrompts
Gets the intelli prompts.
Declaration
public SyntaxEditorIntelliPrompts IntelliPrompts { get; }
Property Value
The intelli prompts.
IsCaretVisible
Gets or sets a value indicating whether the text cursor (caret) is visible in the syntax editor.
IsInUndoGroup
Gets a value indicating whether this instance is in undo group.
Declaration
public bool IsInUndoGroup { get; }
Property Value
true if this instance is in undo group; otherwise, false.
IsOverwriteModeEnabled
Gets or sets a value indicating whether this instance is overwrite mode enabled.
Declaration
public bool IsOverwriteModeEnabled { get; set; }
Property Value
true if this instance is overwrite mode enabled; otherwise, false.
IsReadOnly
Gets or sets a value indicating whether this instance is read only.
Declaration
public bool IsReadOnly { get; set; }
Property Value
true if this instance is read only; otherwise, false.
IsSelectionEnabled
Gets or sets a value indicating whether text selection is enabled in the syntax editor.
IsWordWrapEnabled
Gets or sets a value indicating whether text should automatically wrap to the next line when it exceeds the width of the editor.
Margins
Gets the margins collection that defines the space around the text content in the syntax editor.
Declaration
public SyntaxEditorMargins Margins { get; }
Property Value
Palette
Gets or sets the palette of syntax elements' colors used for this RadSyntaxEditorElement instance.
Declaration
public SyntaxEditorPalette Palette { get; set; }
Property Value
Properties
Gets the collection of properties that control the behavior and appearance of the syntax editor.
Declaration
public SyntaxEditorProperties Properties { get; }
Property Value
ScaleFactor
Gets or sets the zoom level of the syntax editor content as a multiplier value (1.0 is normal size, 2.0 is double size, etc.).
SearchPanel
Gets the popup control that provides find and replace functionality in the editor.
Declaration
public FindReplacePopup SearchPanel { get; }
Property Value
Selection
Gets the selection.
Declaration
public Selection Selection { get; }
Property Value
The selection.
SelectionFill
Gets or sets the selection fill.
Declaration
public Brush SelectionFill { get; set; }
Property Value
The selection fill.
SelectionStroke
Gets or sets the selection stroke.
Declaration
public Brush SelectionStroke { get; set; }
Property Value
The selection stroke.
ShowLineNumbers
Gets or sets a value indicating whether line numbers are displayed in the margin of the syntax editor.
TaggersRegistry
Gets the registry of taggers that provide syntax highlighting and other text analysis functionality for the editor.
Declaration
public TaggersRegistry TaggersRegistry { get; }
Property Value
TextFormatDefinitions
Gets the stack of text format definitions that control the visual appearance of text in the syntax editor.
Declaration
public TextFormatDefinitionStack TextFormatDefinitions { get; }
Property Value
UILayersBuilder
Gets or sets the builder component responsible for creating and managing the visual layers in the syntax editor.
Declaration
public UILayersBuilder UILayersBuilder { get; set; }
Property Value
UseMonospacedFontOptimization
Gets or sets a value indicating whether to apply rendering optimizations for monospaced fonts in the syntax editor.
Declaration
public bool UseMonospacedFontOptimization { get; set; }
Property Value
UseShiftKeyInSelection
Gets or sets a value indicating whether the Shift key is required to extend text selection with arrow keys.
VerticalScrollBar
Gets the vertical scroll bar element that controls scrolling through the document vertically.
Declaration
public RadScrollBarElement VerticalScrollBar { get; }
Property Value
Viewport
Gets the visible rectangular area of the document currently displayed in the editor.
ZoomComboBox
Gets the drop-down list element that allows selecting different zoom levels for the editor content.
Declaration
public RadDropDownListElement ZoomComboBox { get; }
Property Value
Methods
ApplyCachedProperties(bool)
Applies any cached property values to the syntax editor element.
Declaration
protected virtual void ApplyCachedProperties(bool clearCache = true)
Parameters
clearCache
Determines whether the properties cache will be cleared after applying values.
ArrangeInnerMargins(RectangleF)
Arranges the inner margins of the editor content area.
Declaration
protected virtual RectangleF ArrangeInnerMargins(RectangleF clientRect)
Parameters
clientRect
The client rectangle available for the editor content.
Returns
A rectangle that represents the area after applying inner margins.
ArrangeOuterMargins(RectangleF)
Arranges the outer margins of the editor within the available client rectangle.
Declaration
protected virtual RectangleF ArrangeOuterMargins(RectangleF clientRect)
Parameters
clientRect
The client rectangle available for the editor.
Returns
A rectangle that represents the area after applying outer margins.
ArrangeOverride(SizeF)
Arranges the syntax editor element and its children within the final allocated area.
Copy()
Copies the current selection to the clipboard. If no text is selected, copies the entire current line.
Declaration
public void Copy()
CrateSyntaxEditorPresenter()
Creates a new syntax editor presenter that will display and manage the text content.
Declaration
protected virtual SyntaxEditorPresenter CrateSyntaxEditorPresenter()
Returns
A new instance of SyntaxEditorPresenter.
CreateChildElements()
Creates the child elements that make up the structure of the editor.
Declaration
protected override void CreateChildElements()
Overrides
CreateSyntaxEditorHistoryState()
Creates the state of the code editor history.
Declaration
public SyntaxEditorHistoryState CreateSyntaxEditorHistoryState()
Returns
SyntaxEditorHistoryState.
CreateZoomElement()
Creates the zoom drop-down element used for scaling the editor content.
Declaration
protected virtual RadDropDownListElement CreateZoomElement()
Returns
A new RadDropDownListElement configured for zoom level selection.
DecreaseLineIndent()
Decreases the line indent.
Declaration
public void DecreaseLineIndent()
DeleteWordToLeft()
Deletes the word to left.
Declaration
public void DeleteWordToLeft()
DeleteWordToRight()
Deletes the word to right.
Declaration
public void DeleteWordToRight()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Implements
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Find(string, int)
Finds the specified search text.
Find(string, int, bool)
Finds the specified search text.
Find(string, int, bool, bool)
Finds the specified search text.
FindAll(string)
Finds all spans.
FindAll(string, bool)
Finds all spans.
FindAll(string, bool, bool)
Finds all spans.
FindPrevious(string, int, bool)
Finds the specified search text before the current index.
GetContentRect(RectangleF)
Calculates the content rectangle based on the available space, accounting for scroll bars and other elements.
Declaration
protected virtual RectangleF GetContentRect(RectangleF availableRect)
Parameters
availableRect
The rectangle representing the available space.
Returns
A rectangle representing the area for the editor content.
GetLineBoundingRectangleByLineNumber(int, bool)
Gets the bounding rectangle for a specific line in the document.
Declaration
public Rect GetLineBoundingRectangleByLineNumber(int lineNumber, bool cutToBaseline = false)
Parameters
lineNumber
The zero-based line number.
cutToBaseline
If true, adjusts the rectangle to only include up to the text baseline.
Returns
A rectangle representing the bounds of the specified line.
GetLinePartBoundingRectangle(Span, bool)
Gets the bounding rectangle for a specific portion of text within the document.
Declaration
public Rect GetLinePartBoundingRectangle(Span span, bool cutToBaseline = false)
Parameters
span
The span of text to get the bounds for.
cutToBaseline
If true, adjusts the rectangle to only include up to the text baseline.
Returns
A rectangle representing the bounds of the specified text span.
GetPointFromPosition(CaretPosition)
Converts a document caret position to screen coordinates in the editor.
Declaration
public Point GetPointFromPosition(CaretPosition position)
Parameters
position
The caret position in the document.
Returns
The point in screen coordinates corresponding to the caret position.
GetPositionFromControlPoint(Point)
Converts a screen coordinate point to a document caret position.
Declaration
public CaretPosition GetPositionFromControlPoint(Point point)
Parameters
point
The point in screen coordinates relative to the control.
Returns
A caret position in the document corresponding to the specified point.
GetText(CaretPosition, CaretPosition)
Gets the text between the specified start and end positions.
Declaration
public string GetText(CaretPosition start, CaretPosition end)
Parameters
start
end
Returns
GetWordToLeft()
Gets the text within the current word which is to the left of the caret.
GetWordToRight()
Gets the text within the current word which is to the right of the caret.
HighlightAllMatches(string)
Tries to highlight all span matches via all registered TextSearchHighlightTaggers.
Declaration
public void HighlightAllMatches(string searchText)
Parameters
searchText
IncreaseLineIndent()
Increases the line indent.
Declaration
public void IncreaseLineIndent()
InitializeFields()
Initializes the default field values for the editor element.
Declaration
protected override void InitializeFields()
Overrides
Insert(string)
Inserts the specified text.
InvalidateEditorLayout()
Invalidates the layout of the editor, forcing a recalculation of text positions and visual elements.
Declaration
public void InvalidateEditorLayout()
InvalidateEditorLayout(bool)
Invalidates the layout of the editor, forcing a recalculation of text positions and visual elements.
Declaration
public void InvalidateEditorLayout(bool force)
Parameters
force
When true, forces a complete layout recalculation regardless of any optimization conditions.
MeasureInnerMargins(RectangleF)
Measures the inner margins of the editor content area.
Declaration
protected virtual RectangleF MeasureInnerMargins(RectangleF clientRect)
Parameters
clientRect
The client rectangle available for the editor content.
Returns
A rectangle that represents the area after applying inner margins.
MeasureOuterMargins(RectangleF)
Measures the outer margins of the editor within the available client rectangle.
Declaration
protected virtual RectangleF MeasureOuterMargins(RectangleF clientRect)
Parameters
clientRect
The client rectangle available for the editor.
Returns
A rectangle that represents the area after applying outer margins.
MeasureOverride(SizeF)
Measures the desired size of the syntax editor element based on the available space.
MoveCurrentLineToTop()
Moves the current line to top.
Declaration
public void MoveCurrentLineToTop()
NavigateNextMatch(string)
Navigates to the next matched text in the editor.
Declaration
public void NavigateNextMatch(string searchText)
Parameters
searchText
NavigatePreviousMatch(string)
Navigates to the next matched text in the editor.
Declaration
public void NavigatePreviousMatch(string searchText)
Parameters
searchText
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
Declaration
public override void OnApplyTemplate()
Overrides
OnCommandError(CommandErrorEventArgs)
Raises the CommandError event when a command execution results in an error.
Declaration
protected virtual void OnCommandError(CommandErrorEventArgs args)
Parameters
args
The CommandErrorEventArgs instance containing information about the error and the command that failed.
OnCommandExecuted(CommandExecutedEventArgs)
Raises the CommandExecuted event after a command has been successfully executed in the syntax editor.
Declaration
protected virtual void OnCommandExecuted(CommandExecutedEventArgs e)
Parameters
e
The CommandExecutedEventArgs instance containing information about the executed command.
OnCommandExecuting(CommandExecutingEventArgs)
Raises the CommandExecuting event before a command is executed, allowing subscribers to cancel or modify the command execution.
Declaration
protected virtual void OnCommandExecuting(CommandExecutingEventArgs args)
Parameters
args
The CommandExecutingEventArgs instance containing information about the command to be executed and allowing cancellation.
OnDocumentChanged()
Called when the document in the syntax editor has changed, raising the DocumentChanged event.
Declaration
protected virtual void OnDocumentChanged()
OnDocumentChanging()
Called before the document in the syntax editor changes, raising the DocumentChanging event.
Declaration
protected virtual void OnDocumentChanging()
OnDocumentContentChanged(TextContentChangedEventArgs)
Handles the event.
Declaration
protected virtual void OnDocumentContentChanged(TextContentChangedEventArgs args)
Parameters
args
The TextContentChangedEventArgs instance containing the event data.
OnDocumentContentChanging(TextContentChangingEventArgs)
Handles the event.
Declaration
protected virtual void OnDocumentContentChanging(TextContentChangingEventArgs args)
Parameters
args
The TextContentChangingEventArgs instance containing the event data.
OnGotFocus(EventArgs)
Called when the syntax editor element receives input focus, ensuring the caret becomes visible.
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
e
The event arguments.
Overrides
OnIsReadOnlyChanged(EventArgs)
Raises the IsReadOnlyChanged event when the read-only state of the syntax editor changes.
Declaration
protected virtual void OnIsReadOnlyChanged(EventArgs e)
Parameters
e
The event arguments.
OnLayoutPropertiesChanged()
Raises the LayoutPropertiesChanged event when layout properties of the syntax editor have been modified.
Declaration
protected virtual void OnLayoutPropertiesChanged()
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
OnMouseWheelZoom(double)
Called when mouse wheel zoom is requested. Handles changing the scale factor of the editor content based on mouse wheel movement.
OnPreviewSyntaxEditorInput(PreviewSyntaxEditorInputEventArgs)
Raises the PreviewSyntaxEditorInput event when text input is detected in the syntax editor, allowing for processing or cancellation of the input.
Declaration
protected virtual void OnPreviewSyntaxEditorInput(PreviewSyntaxEditorInputEventArgs args)
Parameters
args
PreviewSyntaxEditorInputEventArgs
The PreviewSyntaxEditorInputEventArgs instance containing the event data and providing options to handle or cancel the input.
OnPreviewSyntaxEditorKeyDown(PreviewSyntaxEditorKeyEventArgs)
Handles the event.
Declaration
protected virtual void OnPreviewSyntaxEditorKeyDown(PreviewSyntaxEditorKeyEventArgs args)
Parameters
args
PreviewSyntaxEditorKeyEventArgs
The PreviewSyntaxEditorKeyEventArgs instance containing the event data.
OnPreviewSyntaxEditorKeyUp(PreviewSyntaxEditorKeyEventArgs)
Raises the PreviewSyntaxEditorKeyUp event when a key up action is detected in the syntax editor.
Declaration
protected virtual void OnPreviewSyntaxEditorKeyUp(PreviewSyntaxEditorKeyEventArgs args)
Parameters
args
PreviewSyntaxEditorKeyEventArgs
The event arguments containing information about the key action.
OnPreviewSyntaxEditorMouseLeftButtonDown(PreviewSyntaxEditorMouseButtonEventArgs)
Raises the PreviewSyntaxEditorMouseLeftButtonDown event when a mouse left button down action is detected.
Declaration
protected virtual void OnPreviewSyntaxEditorMouseLeftButtonDown(PreviewSyntaxEditorMouseButtonEventArgs args)
Parameters
args
PreviewSyntaxEditorMouseButtonEventArgs
The event arguments containing information about the mouse action.
OnPreviewSyntaxEditorMouseRightButtonDown(PreviewSyntaxEditorMouseButtonEventArgs)
Raises the PreviewSyntaxEditorMouseRightButtonDown event when a mouse right button down action is detected.
Declaration
protected virtual void OnPreviewSyntaxEditorMouseRightButtonDown(PreviewSyntaxEditorMouseButtonEventArgs args)
Parameters
args
PreviewSyntaxEditorMouseButtonEventArgs
The event arguments containing information about the mouse action.
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value changes, allowing for handling specific property changes in the syntax editor.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
Event arguments containing information about the property that changed.
Overrides
OnScaleFactorChanged()
Called when the zoom level of the editor changes, raising the ScaleFactorChanged event and updating the layout.
Declaration
protected virtual void OnScaleFactorChanged()
OnScaleFactorPropertyCoerced(double)
Ensures that the scale factor value is within the valid range between minimum and maximum scale factors.
OnSelectionChanged()
Raises the SelectionChanged event when the text selection in the syntax editor changes.
Declaration
protected virtual void OnSelectionChanged()
OnViewportChanged()
Raises the ViewportChanged event when the visible area of the syntax editor changes due to scrolling or resizing.
Declaration
protected virtual void OnViewportChanged()
OpenFindDialog(string)
Opens the find dialog with the specified searchText in the search textbox.
Declaration
public void OpenFindDialog(string searchText)
Parameters
searchText
The search text.
PopulateZoomElement()
Populates the zoom drop-down element with the default scale factors (20% to 400%).
Declaration
protected virtual void PopulateZoomElement()
Redo()
Redoes this instance.
ReplaceAllMatches(string, string, bool, bool)
Replaces all matches.
Declaration
public int ReplaceAllMatches(string searchText, string replaceText, bool matchCase, bool useRegularExpression)
Parameters
searchText
The search text.
replaceText
The replace text.
matchCase
The match case.
useRegularExpression
The use regular expression.
Returns
System.Int32.
ReplaceNextMatch(string, int, string, bool, bool)
Replaces the next match.
Declaration
public bool ReplaceNextMatch(string searchText, int startIndex, string replaceText, bool matchCase, bool useRegularExpression)
Parameters
searchText
The search text.
startIndex
The start index.
replaceText
The replace text.
matchCase
The match case.
useRegularExpression
The use regular expression.
Returns
System.Boolean.
RestoreSyntaxEditorHistoryState(SyntaxEditorHistoryState)
Restores the state of the code editor history.
Declaration
public void RestoreSyntaxEditorHistoryState(SyntaxEditorHistoryState historyState)
Parameters
historyState
State of the history.
SelectAll()
Selects all text content in the document.
Declaration
public void SelectAll()
ShouldArrangeChild(RadElement)
Determines whether a child element should be arranged during the layout process.
Declaration
protected override bool ShouldArrangeChild(RadElement child)
Parameters
child
The child element to check.
Returns
True if the child should be arranged; otherwise, false.
Overrides
ShouldMeasureChild(RadElement)
Determines whether a child element should be measured during the layout process.
Declaration
protected override bool ShouldMeasureChild(RadElement child)
Parameters
child
The child element to check.
Returns
True if the child should be measured; otherwise, false.
Overrides
ToggleInsertMode()
Toggles the insert mode.
Declaration
public void ToggleInsertMode()
UpdateSelection()
Updates the visual representation of the current text selection in the editor.
Declaration
public void UpdateSelection()
ZoomIn(double)
Increases the zoom level of the editor content.
Declaration
public void ZoomIn(double zoomFactor = 1.1)
Parameters
zoomFactor
The zoom increase factor. Should be a number greater than 1. Default value is 1.1.
ZoomOut(double)
Decreases the zoom level of the editor content.
Declaration
public void ZoomOut(double zoomFactor = 0.91)
Parameters
zoomFactor
The zoom decrease factor. Should be a number less than 1. Default value is 0.91.
ZoomTo(double)
Sets the zoom level of the editor content to a specific scale factor.
Declaration
public void ZoomTo(double zoomLevel)
Parameters
zoomLevel
The scale factor to set (1.0 is normal size, 2.0 is double size, etc.). The minimum supported zoom level is 0.2 and the maximum supported is 4.
Exceptions
Thrown when zoomLevel is negative.
Events
CommandError
Occurs when a command execution in the syntax editor results in an error, providing details about the error and the command that failed.
Declaration
public event EventHandler<CommandErrorEventArgs> CommandError
Event Value
CommandExecuted
Occurs after a command has been successfully executed in the syntax editor, providing information about the executed command.
Declaration
public event EventHandler<CommandExecutedEventArgs> CommandExecuted
Event Value
CommandExecuting
Occurs before a command is executed, allowing you to cancel or modify the command execution.
Declaration
public event EventHandler<CommandExecutingEventArgs> CommandExecuting
Event Value
DocumentChanged
Occurs after the document in the syntax editor has been changed, such as when a new document is loaded or created.
Declaration
public event EventHandler DocumentChanged
Event Value
Implements
DocumentChanging
Occurs before the document in the syntax editor is changed, allowing you to perform actions before a new document is loaded or created.
Declaration
public event EventHandler DocumentChanging
Event Value
Implements
DocumentContentChanged
Occurs when document content has been changed.
Declaration
public event EventHandler<TextContentChangedEventArgs> DocumentContentChanged
Event Value
Implements
DocumentContentChanging
Occurs when document content is being changed.
Declaration
public event EventHandler<TextContentChangingEventArgs> DocumentContentChanging
Event Value
IsReadOnlyChanged
Occurs when the read-only state of the syntax editor changes, indicating whether editing operations are allowed or restricted.
LayoutPropertiesChanged
Occurs when the layout properties of the editor change, affecting how text is displayed.
Declaration
public event EventHandler LayoutPropertiesChanged
Event Value
PreviewSyntaxEditorInput
Occurs before text input is processed by the syntax editor, allowing you to intercept and modify the input.
Declaration
public event EventHandler<PreviewSyntaxEditorInputEventArgs> PreviewSyntaxEditorInput
Event Value
PreviewSyntaxEditorKeyDown
Occurs before a key down event is processed by the syntax editor, allowing you to intercept and handle keyboard input.
Declaration
public event EventHandler<PreviewSyntaxEditorKeyEventArgs> PreviewSyntaxEditorKeyDown
Event Value
PreviewSyntaxEditorKeyUp
Occurs before a key up event is processed by the syntax editor, allowing you to intercept and handle keyboard input.
Declaration
public event EventHandler<PreviewSyntaxEditorKeyEventArgs> PreviewSyntaxEditorKeyUp
Event Value
PreviewSyntaxEditorMouseLeftButtonDown
Occurs before a mouse left button down event is processed by the syntax editor, allowing you to intercept and handle mouse input.
Declaration
public event EventHandler<PreviewSyntaxEditorMouseButtonEventArgs> PreviewSyntaxEditorMouseLeftButtonDown
Event Value
PreviewSyntaxEditorMouseRightButtonDown
Occurs before a mouse right button down event is processed by the syntax editor, allowing you to intercept and handle context menu or other right-click actions.
Declaration
public event EventHandler<PreviewSyntaxEditorMouseButtonEventArgs> PreviewSyntaxEditorMouseRightButtonDown
Event Value
ScaleFactorChanged
Occurs when the scale factor (zoom level) of the syntax editor changes, affecting the display size of text and UI elements.
SelectionChanged
Occurs when the text selection within the editor changes, either by user interaction or programmatically.
ViewportChanged
Occurs when the visible portion (viewport) of the editor content changes due to scrolling or resizing.