Ejemplo n.º 1
0
        public AnsiConsoleBackend(IAnsiConsole console)
        {
            _console = console ?? throw new ArgumentNullException(nameof(console));
            _builder = new AnsiBuilder(_console.Profile);

            Cursor = new AnsiConsoleCursor(this);
        }
Ejemplo n.º 2
0
        public AnsiConsoleBackend(Profile profile)
        {
            _profile = profile ?? throw new ArgumentNullException(nameof(profile));
            _builder = new AnsiBuilder(profile);

            Cursor = new AnsiConsoleCursor(this);
        }
Ejemplo n.º 3
0
        public LegacyConsoleBackend(IAnsiConsole console)
        {
            _console   = console ?? throw new System.ArgumentNullException(nameof(console));
            _lastStyle = Style.Plain;

            Cursor = new LegacyConsoleCursor();
        }
        public LegacyConsoleBackend(Profile profile)
        {
            _profile   = profile ?? throw new System.ArgumentNullException(nameof(profile));
            _lastStyle = Style.Plain;

            Cursor = new LegacyConsoleCursor();
        }
Ejemplo n.º 5
0
    /// <summary>
    /// Moves the cursor to the left.
    /// </summary>
    /// <param name="cursor">The cursor.</param>
    public static void MoveLeft(this IAnsiConsoleCursor cursor)
    {
        if (cursor is null)
        {
            throw new System.ArgumentNullException(nameof(cursor));
        }

        cursor.Move(CursorDirection.Left, 1);
    }
Ejemplo n.º 6
0
    /// <summary>
    /// Moves the cursor down.
    /// </summary>
    /// <param name="cursor">The cursor.</param>
    /// <param name="steps">The number of steps to move the cursor.</param>
    public static void MoveDown(this IAnsiConsoleCursor cursor, int steps)
    {
        if (cursor is null)
        {
            throw new System.ArgumentNullException(nameof(cursor));
        }

        cursor.Move(CursorDirection.Down, steps);
    }
Ejemplo n.º 7
0
    /// <summary>
    /// Hides the cursor.
    /// </summary>
    /// <param name="cursor">The cursor.</param>
    public static void Hide(this IAnsiConsoleCursor cursor)
    {
        if (cursor is null)
        {
            throw new System.ArgumentNullException(nameof(cursor));
        }

        cursor.Show(false);
    }