LineNumberMargin
Displays one-based line numbers for visible document lines and sizes the gutter for the document's line count.
Definition
Namespace:Telerik.WinForms.Controls.SyntaxEditor.UI.Margins
Assembly:Telerik.WinControls.SyntaxEditor.dll
Syntax:
public class LineNumberMargin : SelectionAwareMargin, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, ISupportDrop
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementUIElementFrameworkElementContentControlSyntaxEditorMarginSelectionAwareMarginLineNumberMargin...
Implements:
Inherited Members
Constructors
Creates a line-number gutter associated with the specified editor.
public LineNumberMargin(RadSyntaxEditorElement syntaxEditor)
The editor whose visible lines are numbered.
Fields
Identifies the dependency property for the line-number text color.
public static readonly RadProperty NumbersColorProperty
Properties
Gets or sets the brush used to draw line numbers; when unset, a solid brush is created from NumbersColor on first access.
public Brush NumbersBrush { get; set; }
Gets or sets the color used for line-number text. Changing this value recreates NumbersBrush.
public Color NumbersColor { get; set; }
Methods
Calculates a gutter width for at least five digits, plus the right-side spacing.
protected virtual double CalculateWidth()
The measured width required for the largest line number and its spacing.
Unsubscribes from editor property changes before releasing managed resources.
protected override void DisposeManagedResources()
Overrides:
Gets the document's total line count, which determines the number of digits reserved by the gutter.
Enables mouse input so users can start text selection from the line-number gutter.
protected override void InitializeFields()
Overrides:
Refreshes the number and separator brushes when their corresponding colors change.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Details of the changed dependency property.
Overrides:
Updates visible line labels, separator geometry, and the clipped canvas for the current viewport.
protected override void UpdateUIOverride(UIUpdateContext updateContext)
Visible-line and layout data for the editor.
Overrides: