DefaultTextViewLineNumberProvider Class
Represents the default implementation of an object that determines the number text to display in a text view's line number margin.
public class DefaultTextViewLineNumberProvider : ITextViewLineNumberProvider
- Inheritance:
- object object
- Implements:
- ITextViewLineNumberProvider
Constructors
DefaultTextViewLineNumberProvider()
Initializes an instance of the class.
public DefaultTextViewLineNumberProvider()
Methods
ConvertLineNumberToString(int)
Converts the specified line number to a string.
public virtual string ConvertLineNumberToString(int lineNumber)
Parameter | Type | Description |
---|---|---|
lineNumber | int | The line number to convert. |
Returns
- string:
The line number in string format.
GetLargestLineNumberText(ITextView)
Returns the largest line number text string that can be displayed for the specified view.
public virtual string GetLargestLineNumberText(ITextView view)
Parameter | Type | Description |
---|---|---|
view | ITextView | The ITextView to examine. |
Returns
- string:
The largest line number text string that can be displayed for the specified view.
Remarks
This method aids in determining how wide a line number margin must be to support displaying all of a view's line numbers.
GetLineNumber(ITextViewLine)
Returns the integer line number for the specified view line.
public virtual int GetLineNumber(ITextViewLine viewLine)
Parameter | Type | Description |
---|---|---|
viewLine | ITextViewLine | The ITextViewLine to examine. |
Returns
- int:
The integer line number for the specified view line.
GetLineNumberOrigin(IEditorDocument)
Returns the origin line number to use as the base for the first view line.
protected virtual int GetLineNumberOrigin(IEditorDocument document)
Parameter | Type | Description |
---|---|---|
document | IEditorDocument | The IEditorDocument to examine. |
Returns
- int:
The origin line number to use as the base for the first view line.
Remarks
The default implementation of this method returns LineNumberOrigin.
GetLineNumberText(ITextViewLine)
Returns the line number text string to display in a line number margin for the specified view line.
public virtual string GetLineNumberText(ITextViewLine viewLine)
Parameter | Type | Description |
---|---|---|
viewLine | ITextViewLine | The ITextViewLine to examine. |
Returns
- string:
The line number text string to display in a line number margin for the specified view line.
Remarks
The default implementation of this method