Class TextEdit
Denotes an edit for text
public class TextEdit
- Inheritance
-
TextEdit
- Inherited Members
Constructors
TextEdit(ParsePosition, ParsePosition, string[])
Creates a new text edit
public TextEdit(ParsePosition start, ParsePosition end, string[] newText)
Parameters
startParsePositionthe start of the edit
endParsePositionthe end of the edit
newTextstring[]the new text inserted between start and end
Exceptions
- ArgumentException
thrown if start is after end
Properties
End
Gets the end of the edit
public ParsePosition End { get; }
Property Value
NewText
Gets the new text inserted between start and end
public string[] NewText { get; }
Property Value
- string[]
Start
Gets the start of the edit
public ParsePosition Start { get; }
Property Value
Methods
AdjustPosition(ParsePosition)
Adjusts the given position due to the current text edit
public ParsePosition AdjustPosition(ParsePosition position)
Parameters
positionParsePositionthe incoming position
Returns
Apply(string[])
Applies the text edit to the given input
public string[] Apply(string[] input)
Parameters
inputstring[]an input array of string lines
Returns
- string[]
a text array including the changes
UpdatePosition(ref ParsePosition)
Updates the position after applying this edit. Only Updates the Postion if it is fully after the Edit.
public void UpdatePosition(ref ParsePosition position)
Parameters
positionParsePositionThe position to update.