Exemplo n.º 1
0
        public void InvokeCursorMove(Vector2 cursorPosition, Vector2 previousCursorPosition, bool isCursorDown)
        {
            var relativeNew = (cursorPosition - RenderPosition).ToPoint();
            var relativeOld = (previousCursorPosition - RenderPosition).ToPoint();

            CursorMove?.Invoke(this, new GuiCursorMoveEventArgs(relativeNew, relativeOld, isCursorDown));

            OnCursorMove(relativeNew, relativeOld, isCursorDown);
        }
Exemplo n.º 2
0
        protected virtual bool HideCusor(ConsoleKeyInfo keyInfo)
        {
            if (CursorPosition == null)
            {
                return(false);
            }

            var old = CursorPosition;

            CursorPosition = null;

            var args = new CursorInformation(old, CursorPosition, keyInfo);

            return(CursorMove?.Invoke(this, args) ?? true);
        }
Exemplo n.º 3
0
        protected virtual bool CursorUp(ConsoleKeyInfo keyInfo)
        {
            if (CursorPosition == null)
            {
                CursorPosition = _windows.Skip(_page * ITEMS_PER_PAGE).Take(ITEMS_PER_PAGE)
                                 .Count();
            }

            if (CursorPosition <= 0)
            {
                return(false);
            }

            var old = CursorPosition--;

            var args = new CursorInformation(old, CursorPosition, keyInfo);

            return(CursorMove?.Invoke(this, args) ?? true);
        }