Class RadSyntaxEditorElement
The primary element of the RadSyntaxEditor control that provides syntax highlighting, text editing, and code visualization capabilities.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.SyntaxEditor.dll
Syntax
public class RadSyntaxEditorElement : FrameworkElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, ISupportDrop, ITextDocumentEditor, IDisposable
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
RadProperty
|
AllowScalingProperty
Registers the AllowScaling dependency property.
Declaration
public static readonly RadProperty AllowScalingProperty
Field Value
RadProperty
|
BorderColorProperty
CaretBrushProperty
Registers the CaretBrush dependency property.
Declaration
public static readonly RadProperty CaretBrushProperty
Field Value
RadProperty
|
DEFAULT_NAMESPACE
Declaration
public static readonly string DEFAULT_NAMESPACE
Field Value
System.String
|
EditorFontFamilyProperty
Registers the EditorFontFamily dependency property.
Declaration
public static readonly RadProperty EditorFontFamilyProperty
Field Value
RadProperty
|
EditorFontSizeProperty
Registers the EditorFontSize dependency property.
Declaration
public static readonly RadProperty EditorFontSizeProperty
Field Value
RadProperty
|
EditorFontStretchProperty
Registers the Telerik.WinControls.UI.RadSyntaxEditorElement.EditorFontStretch dependency property.
Declaration
public static readonly RadProperty EditorFontStretchProperty
Field Value
RadProperty
|
EditorFontStyleProperty
Registers the Telerik.WinControls.UI.RadSyntaxEditorElement.EditorFontStyle dependency property.
Declaration
public static readonly RadProperty EditorFontStyleProperty
Field Value
RadProperty
|
EditorFontWeightProperty
Registers the Telerik.WinControls.UI.RadSyntaxEditorElement.EditorFontWeight dependency property.
Declaration
public static readonly RadProperty EditorFontWeightProperty
Field Value
RadProperty
|
HorizontalScrollBarVisibilityProperty
Registers the HorizontalScrollBarVisibility dependency property.
Declaration
public static readonly RadProperty HorizontalScrollBarVisibilityProperty
Field Value
RadProperty
|
IndentProviderProperty
Registers the IndentProvider property.
Declaration
public static readonly RadProperty IndentProviderProperty
Field Value
RadProperty
|
InsertModeProperty
Registers the InsertMode property.
Declaration
public static readonly RadProperty InsertModeProperty
Field Value
RadProperty
|
IsCaretVisibleProperty
Registers the IsCaretVisible dependency property.
Declaration
public static readonly RadProperty IsCaretVisibleProperty
Field Value
RadProperty
|
IsReadOnlyProperty
Registers the IsReadOnly property.
Declaration
public static readonly RadProperty IsReadOnlyProperty
Field Value
RadProperty
|
IsSelectionEnabledProperty
Registers the IsSelectionEnabled dependency property.
Declaration
public static readonly RadProperty IsSelectionEnabledProperty
Field Value
RadProperty
|
IsWordWrapEnabledProperty
Registers the IsWordWrapEnabledProperty dependency property.
Declaration
public static readonly RadProperty IsWordWrapEnabledProperty
Field Value
RadProperty
|
PaletteProperty
Registers the Palette dependency property.
Declaration
public static readonly RadProperty PaletteProperty
Field Value
RadProperty
|
ScaleFactorProperty
Registers the ScaleFactor dependency property.
Declaration
public static readonly RadProperty ScaleFactorProperty
Field Value
RadProperty
|
SelectionFillColorProperty
SelectionFillProperty
Registers the SelectionFill dependency property.
Declaration
public static readonly RadProperty SelectionFillProperty
Field Value
RadProperty
|
SelectionStrokeColorProperty
SelectionStrokeProperty
Registers the SelectionStroke dependency property.
Declaration
public static readonly RadProperty SelectionStrokeProperty
Field Value
RadProperty
|
ShouldTaggersProcessEntireLinesProperty
Registers the ShouldTaggersProcessEntireLinesProperty dependency property.
Declaration
public static readonly RadProperty ShouldTaggersProcessEntireLinesProperty
Field Value
RadProperty
|
ShowLineNumbersProperty
Registers the ShowLineNumbers dependency property.
Declaration
public static readonly RadProperty ShowLineNumbersProperty
Field Value
RadProperty
|
VerticalScrollBarVisibilityProperty
Registers the VerticalScrollBarVisibility dependency property.
Declaration
public static readonly RadProperty VerticalScrollBarVisibilityProperty
Field Value
RadProperty
|
Properties
AcceptsReturn
Gets or sets a value indicating whether [accepts return].
Declaration
public bool AcceptsReturn { get; set; }
Property Value
System.Boolean
|
AllowScaling
Gets or sets a value indicating whether the content of the syntax editor can be scaled (zoomed in or out).
Declaration
public bool AllowScaling { get; set; }
Property Value
System.Boolean
|
BorderColor
Gets or sets the color of the border around the syntax editor.
Declaration
[VsbBrowsable(true)]
public Color BorderColor { get; set; }
Property Value
System.Drawing.Color
|
CaretBrush
Gets or sets the brush used to render the text cursor (caret) in the syntax editor.
Declaration
public Brush CaretBrush { get; set; }
Property Value
System.Drawing.Brush
|
CaretColor
Gets or sets the color of the text cursor (caret) in the syntax editor.
Declaration
public Color CaretColor { get; set; }
Property Value
System.Drawing.Color
|
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
CaretDisplayMode
|
CaretPosition
Gets the current position of the text cursor (caret) within the document.
Declaration
public CaretPosition CaretPosition { get; }
Property Value
CaretPosition
|
CaretWidth
Gets or sets the width of the text cursor (caret) in the syntax editor.
Declaration
public double CaretWidth { get; set; }
Property Value
System.Double
|
Commands
Gets the collection of available editor commands that can be executed on this syntax editor.
Declaration
public SyntaxEditorCommands Commands { get; }
Property Value
SyntaxEditorCommands
|
CurrentInsertMode
Gets or sets the current insert mode.
Declaration
public string CurrentInsertMode { get; set; }
Property Value
System.String
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
TextDocument
|
Implements
EditorFontFamily
Gets or sets the font family used to render text in the syntax editor.
Declaration
public FontFamily EditorFontFamily { get; set; }
Property Value
FontFamily
|
EditorFontSize
Gets or sets the font size used to render text in the syntax editor.
Declaration
public double EditorFontSize { get; set; }
Property Value
System.Double
|
EditorPresenter
Gets the presenter component responsible for rendering and displaying the text content in the syntax editor.
Declaration
public SyntaxEditorPresenter EditorPresenter { get; }
Property Value
SyntaxEditorPresenter
|
FoldingManager
Gets the component responsible for handling code folding functionality, allowing collapsing and expanding of code regions.
Declaration
public FoldingManager FoldingManager { get; }
Property Value
FoldingManager
|
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
RadScrollBarElement
|
HorizontalScrollBarVisibility
This property is not relevant for this class.
Declaration
public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
Property Value
ScrollBarVisibility
|
IndentProvider
Gets or sets the indent provider.
Declaration
public ISmartIndentProvider IndentProvider { get; set; }
Property Value
ISmartIndentProvider
The indent provider. |
InputHandler
Gets or sets an instance of SyntaxEditorInputBehavior that will handle user input.
Declaration
public SyntaxEditorInputBehavior InputHandler { get; set; }
Property Value
SyntaxEditorInputBehavior
|
IntelliPrompts
Gets the intelli prompts.
Declaration
public SyntaxEditorIntelliPrompts IntelliPrompts { get; }
Property Value
SyntaxEditorIntelliPrompts
The intelli prompts. |
IsCaretVisible
Gets or sets a value indicating whether the text cursor (caret) is visible in the syntax editor.
Declaration
public bool IsCaretVisible { get; set; }
Property Value
System.Boolean
|
IsInUndoGroup
Gets a value indicating whether this instance is in undo group.
Declaration
public bool IsInUndoGroup { get; }
Property Value
System.Boolean
|
IsOverwriteModeEnabled
Gets or sets a value indicating whether this instance is overwrite mode enabled.
Declaration
public bool IsOverwriteModeEnabled { get; set; }
Property Value
System.Boolean
|
IsReadOnly
Gets or sets a value indicating whether this instance is read only.
Declaration
public bool IsReadOnly { get; set; }
Property Value
System.Boolean
|
IsSelectionEnabled
Gets or sets a value indicating whether text selection is enabled in the syntax editor.
Declaration
public bool IsSelectionEnabled { get; set; }
Property Value
System.Boolean
|
IsWordWrapEnabled
Gets or sets a value indicating whether text should automatically wrap to the next line when it exceeds the width of the editor.
Declaration
public bool IsWordWrapEnabled { get; set; }
Property Value
System.Boolean
|
Margins
Gets the margins collection that defines the space around the text content in the syntax editor.
Declaration
public SyntaxEditorMargins Margins { get; }
Property Value
SyntaxEditorMargins
|
Palette
Gets or sets the palette of syntax elements' colors used for this RadSyntaxEditorElement instance.
Declaration
public SyntaxEditorPalette Palette { get; set; }
Property Value
SyntaxEditorPalette
|
Properties
Gets the collection of properties that control the behavior and appearance of the syntax editor.
Declaration
public SyntaxEditorProperties Properties { get; }
Property Value
SyntaxEditorProperties
|
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.).
Declaration
public double ScaleFactor { get; set; }
Property Value
System.Double
|
SearchPanel
Gets the popup control that provides find and replace functionality in the editor.
Declaration
public FindReplacePopup SearchPanel { get; }
Property Value
FindReplacePopup
|
Selection
Gets the selection.
Declaration
public Selection Selection { get; }
Property Value
Selection
The selection. |
SelectionFill
Gets or sets the selection fill.
Declaration
public Brush SelectionFill { get; set; }
Property Value
System.Drawing.Brush
The selection fill. |
SelectionFillColor
This property is not relevant for this class.
Declaration
[VsbBrowsable(true)]
public Color SelectionFillColor { get; set; }
Property Value
System.Drawing.Color
|
SelectionStroke
Gets or sets the selection stroke.
Declaration
public Brush SelectionStroke { get; set; }
Property Value
System.Drawing.Brush
The selection stroke. |
SelectionStrokeColor
This property is not relevant for this class.
Declaration
[VsbBrowsable(true)]
public Color SelectionStrokeColor { get; set; }
Property Value
System.Drawing.Color
|
ShowLineNumbers
Gets or sets a value indicating whether line numbers are displayed in the margin of the syntax editor.
Declaration
public bool ShowLineNumbers { get; set; }
Property Value
System.Boolean
|
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
TaggersRegistry
|
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
TextFormatDefinitionStack
|
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
UILayersBuilder
|
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
System.Boolean
|
UseShiftKeyInSelection
Gets or sets a value indicating whether the Shift key is required to extend text selection with arrow keys.
Declaration
public bool UseShiftKeyInSelection { get; set; }
Property Value
System.Boolean
|
VerticalScrollBar
Gets the vertical scroll bar element that controls scrolling through the document vertically.
Declaration
public RadScrollBarElement VerticalScrollBar { get; }
Property Value
RadScrollBarElement
|
VerticalScrollBarVisibility
This property is not relevant for this class.
Declaration
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Property Value
ScrollBarVisibility
|
Viewport
Gets the visible rectangular area of the document currently displayed in the editor.
Declaration
public Rect Viewport { get; }
Property Value
Rect
|
ZoomComboBox
Gets the drop-down list element that allows selecting different zoom levels for the editor content.
Declaration
public RadDropDownListElement ZoomComboBox { get; }
Property Value
RadDropDownListElement
|
Methods
ApplyCachedProperties(Boolean)
Applies any cached property values to the syntax editor element.
Declaration
protected virtual void ApplyCachedProperties(bool clearCache = true)
Parameters
System.Boolean
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
System.Drawing.RectangleF
clientRect
The client rectangle available for the editor content. |
Returns
System.Drawing.RectangleF
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
System.Drawing.RectangleF
clientRect
The client rectangle available for the editor. |
Returns
System.Drawing.RectangleF
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.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.Drawing.SizeF
finalSize
The final area that the parent element allocates to the child element. |
Returns
System.Drawing.SizeF
The actual size used by the element. |
Overrides
Backspace()
Backspaces this instance.
Declaration
public void Backspace()
BeginUndoGroup()
Begins the undo group.
Declaration
public void BeginUndoGroup()
CancelUndoGroup()
Cancels the undo group.
Declaration
public void CancelUndoGroup()
CloseFindDialog()
Closes the find dialog.
Declaration
public void CloseFindDialog()
CompleteCode()
Completes the code.
Declaration
public void CompleteCode()
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
SyntaxEditorPresenter
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
SyntaxEditorHistoryState. |
CreateZoomElement()
Creates the zoom drop-down element used for scaling the editor content.
Declaration
protected virtual RadDropDownListElement CreateZoomElement()
Returns
RadDropDownListElement
A new RadDropDownListElement configured for zoom level selection. |
Cut()
Cuts this instance.
Declaration
public void Cut()
DecreaseLineIndent()
Decreases the line indent.
Declaration
public void DecreaseLineIndent()
Delete()
Deletes this instance.
Declaration
public void Delete()
DeleteFullLine()
Deletes the full line.
Declaration
public void DeleteFullLine()
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(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
EndUndoGroup()
Ends the undo group.
Declaration
public void EndUndoGroup()
Find(String, Int32)
Finds the specified search text.
Declaration
public Span? Find(string searchText, int startIndex)
Parameters
System.String
searchText
The search text. |
System.Int32
startIndex
The start index. |
Returns
System.Nullable<Span>
System.Nullable<Span>. |
Find(String, Int32, Boolean)
Finds the specified search text.
Declaration
public Span? Find(string searchText, int startIndex, bool useRegularExpression)
Parameters
System.String
searchText
The search text. |
System.Int32
startIndex
The start index. |
System.Boolean
useRegularExpression
If set to |
Returns
System.Nullable<Span>
System.Nullable<Span>. |
Find(String, Int32, Boolean, Boolean)
Finds the specified search text.
Declaration
public Span? Find(string searchText, int startIndex, bool matchCase, bool useRegularExpression)
Parameters
System.String
searchText
|
System.Int32
startIndex
|
System.Boolean
matchCase
|
System.Boolean
useRegularExpression
|
Returns
System.Nullable<Span>
|
FindAll(String)
Finds all spans.
Declaration
public IEnumerable<Span> FindAll(string searchText)
Parameters
System.String
searchText
The search text. |
Returns
System.Collections.Generic.IEnumerable<Span>
IEnumerable<Span>. |
FindAll(String, Boolean)
Finds all spans.
Declaration
public IEnumerable<Span> FindAll(string searchText, bool useRegularExpression)
Parameters
System.String
searchText
|
System.Boolean
useRegularExpression
|
Returns
System.Collections.Generic.IEnumerable<Span>
|
FindAll(String, Boolean, Boolean)
Finds all spans.
Declaration
public IEnumerable<Span> FindAll(string searchText, bool matchCase, bool useRegularExpression)
Parameters
System.String
searchText
|
System.Boolean
matchCase
|
System.Boolean
useRegularExpression
|
Returns
System.Collections.Generic.IEnumerable<Span>
|
FindPrevious(String, Int32, Boolean)
Finds the specified search text before the current index.
Declaration
public Span? FindPrevious(string searchText, int startIndex, bool matchCase)
Parameters
System.String
searchText
|
System.Int32
startIndex
|
System.Boolean
matchCase
|
Returns
System.Nullable<Span>
|
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
System.Drawing.RectangleF
availableRect
The rectangle representing the available space. |
Returns
System.Drawing.RectangleF
A rectangle representing the area for the editor content. |
GetLineBoundingRectangleByLineNumber(Int32, Boolean)
Gets the bounding rectangle for a specific line in the document.
Declaration
public Rect GetLineBoundingRectangleByLineNumber(int lineNumber, bool cutToBaseline = false)
Parameters
System.Int32
lineNumber
The zero-based line number. |
System.Boolean
cutToBaseline
If true, adjusts the rectangle to only include up to the text baseline. |
Returns
Rect
A rectangle representing the bounds of the specified line. |
GetLinePartBoundingRectangle(Span, Boolean)
Gets the bounding rectangle for a specific portion of text within the document.
Declaration
public Rect GetLinePartBoundingRectangle(Span span, bool cutToBaseline = false)
Parameters
Span
span
The span of text to get the bounds for. |
System.Boolean
cutToBaseline
If true, adjusts the rectangle to only include up to the text baseline. |
Returns
Rect
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
CaretPosition
position
The caret position in the document. |
Returns
Point
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
System.Drawing.Point
point
The point in screen coordinates relative to the control. |
Returns
CaretPosition
A caret position in the document corresponding to the specified point. |
GetPositionFromPoint(Point)
This property is not relevant for this class.
Declaration
public CaretPosition GetPositionFromPoint(Point point)
Parameters
System.Drawing.Point
point
The point relative to the editor presenter. |
Returns
CaretPosition
A caret position 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
CaretPosition
start
|
CaretPosition
end
|
Returns
System.String
|
GetWordToLeft()
Gets the text within the current word which is to the left of the caret.
Declaration
public string GetWordToLeft()
Returns
System.String
|
GetWordToRight()
Gets the text within the current word which is to the right of the caret.
Declaration
public string GetWordToRight()
Returns
System.String
|
HighlightAllMatches(String)
Tries to highlight all span matches via all registered TextSearchHighlightTaggers.
Declaration
public void HighlightAllMatches(string searchText)
Parameters
System.String
searchText
|
IncreaseLineIndent()
Increases the line indent.
Declaration
public void IncreaseLineIndent()
Indent()
Indents this instance.
Declaration
public void Indent()
InitializeFields()
Initializes the default field values for the editor element.
Declaration
protected override void InitializeFields()
Overrides
Insert(String)
Inserts the specified text.
Declaration
public void Insert(string text)
Parameters
System.String
text
The text. |
InsertNewLine()
Inserts the new line.
Declaration
public void InsertNewLine()
InsertTab()
Inserts the tab.
Declaration
public void InsertTab()
InvalidateEditorLayout()
Invalidates the layout of the editor, forcing a recalculation of text positions and visual elements.
Declaration
public void InvalidateEditorLayout()
InvalidateEditorLayout(Boolean)
Invalidates the layout of the editor, forcing a recalculation of text positions and visual elements.
Declaration
public void InvalidateEditorLayout(bool force)
Parameters
System.Boolean
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
System.Drawing.RectangleF
clientRect
The client rectangle available for the editor content. |
Returns
System.Drawing.RectangleF
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
System.Drawing.RectangleF
clientRect
The client rectangle available for the editor. |
Returns
System.Drawing.RectangleF
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.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
The available size that the parent element can allocate to the child element. |
Returns
System.Drawing.SizeF
The desired size of the element. |
Overrides
MoveCurrentLineToTop()
Moves the current line to top.
Declaration
public void MoveCurrentLineToTop()
NavigateNextMatch(String)
NavigatePreviousMatch(String)
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.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
CommandErrorEventArgs
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
CommandExecutedEventArgs
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
CommandExecutingEventArgs
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 DocumentContentChanged event.
Declaration
protected virtual void OnDocumentContentChanged(TextContentChangedEventArgs args)
Parameters
TextContentChangedEventArgs
args
The TextContentChangedEventArgs instance containing the event data. |
OnDocumentContentChanging(TextContentChangingEventArgs)
Handles the DocumentContentChanging event.
Declaration
protected virtual void OnDocumentContentChanging(TextContentChangingEventArgs args)
Parameters
TextContentChangingEventArgs
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
System.EventArgs
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
System.EventArgs
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()
OnMouseWheelZoom(Double)
Called when mouse wheel zoom is requested. Handles changing the scale factor of the editor content based on mouse wheel movement.
Declaration
protected virtual bool OnMouseWheelZoom(double delta)
Parameters
System.Double
delta
The mouse wheel delta. Positive values zoom in, negative values zoom out. |
Returns
System.Boolean
True if the zoom operation was successful; otherwise, false. |
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
PreviewSyntaxEditorInputEventArgs
args
The PreviewSyntaxEditorInputEventArgs instance containing the event data and providing options to handle or cancel the input. |
OnPreviewSyntaxEditorKeyDown(PreviewSyntaxEditorKeyEventArgs)
Handles the PreviewSyntaxEditorKeyDown event.
Declaration
protected virtual void OnPreviewSyntaxEditorKeyDown(PreviewSyntaxEditorKeyEventArgs args)
Parameters
PreviewSyntaxEditorKeyEventArgs
args
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
PreviewSyntaxEditorKeyEventArgs
args
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
PreviewSyntaxEditorMouseButtonEventArgs
args
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
PreviewSyntaxEditorMouseButtonEventArgs
args
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
RadPropertyChangedEventArgs
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.
Declaration
protected virtual double OnScaleFactorPropertyCoerced(double baseValue)
Parameters
System.Double
baseValue
The proposed scale factor value to be validated. |
Returns
System.Double
A scale factor value that is within the allowed range. |
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
System.String
searchText
The search text. |
PageDown()
Pages down.
Declaration
public void PageDown()
PageUp()
Pages up.
Declaration
public void PageUp()
Paste()
Pastes this instance.
Declaration
public void Paste()
PopulateZoomElement()
Populates the zoom drop-down element with the default scale factors (20% to 400%).
Declaration
protected virtual void PopulateZoomElement()
Redo()
Redoes this instance.
Declaration
public bool Redo()
Returns
System.Boolean
System.Boolean. |
ReplaceAllMatches(String, String, Boolean, Boolean)
Replaces all matches.
Declaration
public int ReplaceAllMatches(string searchText, string replaceText, bool matchCase, bool useRegularExpression)
Parameters
System.String
searchText
The search text. |
System.String
replaceText
The replace text. |
System.Boolean
matchCase
The match case. |
System.Boolean
useRegularExpression
The use regular expression. |
Returns
System.Int32
System.Int32. |
ReplaceNextMatch(String, Int32, String, Boolean, Boolean)
Replaces the next match.
Declaration
public bool ReplaceNextMatch(string searchText, int startIndex, string replaceText, bool matchCase, bool useRegularExpression)
Parameters
System.String
searchText
The search text. |
System.Int32
startIndex
The start index. |
System.String
replaceText
The replace text. |
System.Boolean
matchCase
The match case. |
System.Boolean
useRegularExpression
The use regular expression. |
Returns
System.Boolean
System.Boolean. |
RestoreSyntaxEditorHistoryState(SyntaxEditorHistoryState)
Restores the state of the code editor history.
Declaration
public void RestoreSyntaxEditorHistoryState(SyntaxEditorHistoryState historyState)
Parameters
SyntaxEditorHistoryState
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
RadElement
child
The child element to check. |
Returns
System.Boolean
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
RadElement
child
The child element to check. |
Returns
System.Boolean
True if the child should be measured; otherwise, false. |
Overrides
ToggleInsertMode()
Toggles the insert mode.
Declaration
public void ToggleInsertMode()
Undo()
Undoes this instance.
Declaration
public bool Undo()
Returns
System.Boolean
|
Unindent()
Unindents this instance.
Declaration
public void Unindent()
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
System.Double
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
System.Double
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
System.Double
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
System.ArgumentOutOfRangeException
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 Type
System.EventHandler<CommandErrorEventArgs>
|
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 Type
System.EventHandler<CommandExecutedEventArgs>
|
CommandExecuting
Occurs before a command is executed, allowing you to cancel or modify the command execution.
Declaration
public event EventHandler<CommandExecutingEventArgs> CommandExecuting
Event Type
System.EventHandler<CommandExecutingEventArgs>
|
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 Type
System.EventHandler
|
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 Type
System.EventHandler
|
Implements
DocumentContentChanged
Occurs when document content has been changed.
Declaration
public event EventHandler<TextContentChangedEventArgs> DocumentContentChanged
Event Type
System.EventHandler<TextContentChangedEventArgs>
|
Implements
DocumentContentChanging
Occurs when document content is being changed.
Declaration
public event EventHandler<TextContentChangingEventArgs> DocumentContentChanging
Event Type
System.EventHandler<TextContentChangingEventArgs>
|
IsReadOnlyChanged
Occurs when the read-only state of the syntax editor changes, indicating whether editing operations are allowed or restricted.
Declaration
public event EventHandler IsReadOnlyChanged
Event Type
System.EventHandler
|
LayoutPropertiesChanged
Occurs when the layout properties of the editor change, affecting how text is displayed.
Declaration
public event EventHandler LayoutPropertiesChanged
Event Type
System.EventHandler
|
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 Type
System.EventHandler<PreviewSyntaxEditorInputEventArgs>
|
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 Type
System.EventHandler<PreviewSyntaxEditorKeyEventArgs>
|
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 Type
System.EventHandler<PreviewSyntaxEditorKeyEventArgs>
|
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 Type
System.EventHandler<PreviewSyntaxEditorMouseButtonEventArgs>
|
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 Type
System.EventHandler<PreviewSyntaxEditorMouseButtonEventArgs>
|
ScaleFactorChanged
Occurs when the scale factor (zoom level) of the syntax editor changes, affecting the display size of text and UI elements.
Declaration
public event EventHandler ScaleFactorChanged
Event Type
System.EventHandler
|
SelectionChanged
Occurs when the text selection within the editor changes, either by user interaction or programmatically.
Declaration
public event EventHandler SelectionChanged
Event Type
System.EventHandler
|
ViewportChanged
Occurs when the visible portion (viewport) of the editor content changes due to scrolling or resizing.
Declaration
public event EventHandler ViewportChanged
Event Type
System.EventHandler
|