public IInputPositionCalculator Reset(IReadOnlyInputBuffer buffer, int startCursorTop) { this.ValidateInparameters(buffer, startCursorTop); this._buffer = buffer; this._topRow = startCursorTop; return(this); }
public CursorInformation(IReadOnlyInputBuffer buffer, int topRow, IConsoleInformation consoleInformation) { this.ValidateInparameters(buffer, topRow); this._buffer = buffer; this.TopRow = topRow; this.FirstColumn = this._buffer.FirstColumnIndex; this._consoleInformation = consoleInformation.If().Null.Throw().Null(nameof(consoleInformation)); }
public InputPositionCalculator(IReadOnlyInputBuffer buffer, int topRow, IConsoleInformation consoleInformation) { this.ValidateInparameters(buffer, topRow); this._buffer = buffer; this._topRow = topRow; this._consoleInformation = consoleInformation .If().Null.Throw().Null(nameof(consoleInformation)); }
public ICursorInformation Reset(IReadOnlyInputBuffer buffer, int topRow) { this.ValidateInparameters(buffer, topRow); this._buffer = buffer; this.TopRow = topRow; this.FirstColumn = this._buffer.FirstColumnIndex; return(this); }
private void ValidateInparameters(IReadOnlyInputBuffer buffer, int topRow) { buffer.If().Null.Throw().Null(nameof(buffer)); topRow.If().LessThan(0).Throw().OutOfRange(nameof(topRow), topRow, "Cannot be less than 0"); }
private void ValidateInparameters(IReadOnlyInputBuffer buffer, int startCursorTop) { buffer.If().Null.Throw().Null(nameof(buffer)); startCursorTop.If().LessThan(0).Throw().OutOfRange(nameof(startCursorTop), 0, "Cannot be less than 0."); }
public IInputPositionCalculator CreateInputPositionCalculator(IReadOnlyInputBuffer buffer, int startCursorTop) => new InputPositionCalculator(buffer, startCursorTop, this._consoleInformation);
public ICursorInformation CreateCursorInformation(IReadOnlyInputBuffer buffer, int startCursorTop) => new CursorInformation(buffer, startCursorTop, this._consoleInformation);