Class LineState
- Namespace
- InteractiveReadLine
- Assembly
- InteractiveReadLine.dll
Contains the text and cursor position data produced by a user's interaction with the IReadLineProvider.
public class LineState : IEquatable<LineState>
- Inheritance
-
LineState
- Implements
- Inherited Members
Constructors
LineState(string, int)
Creates a line state from the text of a line and a cursor position within it.
public LineState(string text, int cursor)
Parameters
textstringThe contents of the line
cursorintThe cursor position, as an offset from the first character
Properties
Cursor
Gets the cursor position as an integer offset from the first character
public int Cursor { get; }
Property Value
Text
Gets the string contents of the line of text
public string Text { get; }
Property Value
Methods
Equals(LineState?)
Determines whether this line state holds the same text and cursor position as another.
public bool Equals(LineState? other)
Parameters
otherLineState
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Operators
implicit operator LineState(string)
A string can implicitly be converted to a LineState, however the cursor position will be 0 by default.
public static implicit operator LineState(string s)
Parameters
sstring