In This Article

EditorLineNumberMargin Class

Represents a default implementation of a line number margin for an IEditorView.

public class EditorLineNumberMargin : EditorViewMarginBase, IInputElement, IUIElement, ILogicalTreeNode, IDpiAwareElement, IDisposable, IEditorViewMargin, ITextViewMargin, IOrderable, IKeyedObject
Inheritance:
object MarshalByRefObject MarshalByRefDisposableObject LogicalTreeNodeBase UIElement EditorViewMarginBase object
Implements:
IInputElement IUIElement ILogicalTreeNode IDpiAwareElement IDisposable IEditorViewMargin ITextViewMargin IOrderable IKeyedObject

Constructors

EditorLineNumberMargin(IEditorView)

Initializes an instance of the class.

public EditorLineNumberMargin(IEditorView view)
Parameter Type Description
view IEditorView

The IEditorView that will host the margin.

Methods

Draw(TextViewDrawContext)

Draws the margin and its content.

public override void Draw(TextViewDrawContext context)
Parameter Type Description
context TextViewDrawContext

The TextViewDrawContext to use for rendering.

GetCursor(Point)

Returns the Cursor that should be used when the mouse is over the element at the specified Point.

public override Cursor? GetCursor(Point point)
Parameter Type Description
point Point

The Point to examine.

Returns

Cursor

MeasureOverride(Graphics?, Size)

Measures the size in layout required for child elements and determines a size for the element itself.

protected override Size MeasureOverride(Graphics? g, Size availableSize)
Parameter Type Description
g Graphics

The Graphics object to use for measurement.

availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

Remarks

Element authors should override this method, call Measure(Graphics?, Size) on each visible child element and determine the total size required.

UpdateVisibility()

Updates the visibility of the margin.

public override void UpdateVisibility()

Inherited Members

Extension Methods