Table of Contents

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

text string

The contents of the line

cursor int

The 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

int

Text

Gets the string contents of the line of text

public string Text { get; }

Property Value

string

Methods

Equals(LineState?)

Determines whether this line state holds the same text and cursor position as another.

public bool Equals(LineState? other)

Parameters

other LineState

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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

s string

Returns

LineState