Esempio n. 1
0
 public IInputPositionCalculator Reset(IReadOnlyInputBuffer buffer, int startCursorTop)
 {
     this.ValidateInparameters(buffer, startCursorTop);
     this._buffer = buffer;
     this._topRow = startCursorTop;
     return(this);
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        public ICursorInformation Reset(IReadOnlyInputBuffer buffer, int topRow)
        {
            this.ValidateInparameters(buffer, topRow);

            this._buffer     = buffer;
            this.TopRow      = topRow;
            this.FirstColumn = this._buffer.FirstColumnIndex;

            return(this);
        }
Esempio n. 5
0
 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");
 }
Esempio n. 6
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.");
 }
Esempio n. 7
0
 public IInputPositionCalculator CreateInputPositionCalculator(IReadOnlyInputBuffer buffer, int startCursorTop) => new InputPositionCalculator(buffer, startCursorTop, this._consoleInformation);
Esempio n. 8
0
 public ICursorInformation CreateCursorInformation(IReadOnlyInputBuffer buffer, int startCursorTop) => new CursorInformation(buffer, startCursorTop, this._consoleInformation);