public void OnOutput(char c)
    {
        if (_processEscape(c))
        {
            ScreenUpdated?.Invoke();
            return;
        }

        if (!ASCII.IsPrintable(c))
        {
            switch (c)
            {
            case '\n':
                _cursorMove(0, 1, false, true);
                break;

            case '\r':
                _cursorX = 0;
                break;

            case (char)ASCII.BS:
                Lines[_cursorY].Columns[_cursorX] = new Glyph();
                _cursorMove(-1, 0);
                break;

            case (char)ASCII.DEL:
                Lines[_cursorY].Columns[_cursorX] = new Glyph();
                break;
            }

            return;
        }

        Lines[_cursorY].Columns[_cursorX] = new Glyph
        {
            Character       = c,
            Attributes      = _currentAttributes,
            ForegroundColor = _currentForeground,
            BackgroundColor = _currentBackground
        };

        _cursorMove(1, 0, true, true);

        ScreenUpdated?.Invoke();
    }
Beispiel #2
0
 protected virtual void OnScreenUpdated(IEnumerable <string> lines)
 {
     ScreenUpdated?.Invoke(this, lines);
 }