Search Results for

    Show / Hide Table of Contents

    Class FakeDriver

    Implements a mock ConsoleDriver for unit testing
    Inheritance
    object
    ConsoleDriver
    FakeDriver
    Inherited Members
    ConsoleDriver.TerminalResized
    ConsoleDriver.MakePrintable(Rune)
    ConsoleDriver.IsValidContent(int, int, Rect)
    ConsoleDriver.CurrentAttribute
    ConsoleDriver.SetTerminalResized(Action)
    ConsoleDriver.DrawWindowTitle(Rect, ustring, int, int, int, int, TextAlignment)
    ConsoleDriver.Diagnostics
    ConsoleDriver.DrawWindowFrame(Rect, int, int, int, int, bool, bool, Border)
    ConsoleDriver.DrawFrame(Rect, int, bool)
    ConsoleDriver.Clip
    ConsoleDriver.HLine
    ConsoleDriver.VLine
    ConsoleDriver.Stipple
    ConsoleDriver.Diamond
    ConsoleDriver.ULCorner
    ConsoleDriver.LLCorner
    ConsoleDriver.URCorner
    ConsoleDriver.LRCorner
    ConsoleDriver.LeftTee
    ConsoleDriver.RightTee
    ConsoleDriver.TopTee
    ConsoleDriver.BottomTee
    ConsoleDriver.Checked
    ConsoleDriver.UnChecked
    ConsoleDriver.Selected
    ConsoleDriver.UnSelected
    ConsoleDriver.RightArrow
    ConsoleDriver.LeftArrow
    ConsoleDriver.DownArrow
    ConsoleDriver.UpArrow
    ConsoleDriver.LeftDefaultIndicator
    ConsoleDriver.RightDefaultIndicator
    ConsoleDriver.LeftBracket
    ConsoleDriver.RightBracket
    ConsoleDriver.BlocksMeterSegment
    ConsoleDriver.ContinuousMeterSegment
    ConsoleDriver.HDLine
    ConsoleDriver.VDLine
    ConsoleDriver.ULDCorner
    ConsoleDriver.LLDCorner
    ConsoleDriver.URDCorner
    ConsoleDriver.LRDCorner
    ConsoleDriver.HRLine
    ConsoleDriver.VRLine
    ConsoleDriver.ULRCorner
    ConsoleDriver.LLRCorner
    ConsoleDriver.URRCorner
    ConsoleDriver.LRRCorner
    ConsoleDriver.GetAttribute()
    ConsoleDriver.InitalizeColorSchemes(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public class FakeDriver : ConsoleDriver

    Constructors

    | Edit this page View Source

    FakeDriver()

    Declaration
    public FakeDriver()

    Fields

    | Edit this page View Source

    FakeBehaviors

    Declaration
    public static FakeDriver.Behaviors FakeBehaviors
    Field Value
    Type Description
    FakeDriver.Behaviors

    Properties

    | Edit this page View Source

    Clipboard

    Get the operation system clipboard.
    Declaration
    public override IClipboard Clipboard { get; }
    Property Value
    Type Description
    IClipboard
    Overrides
    ConsoleDriver.Clipboard
    | Edit this page View Source

    Cols

    The current number of columns in the terminal.
    Declaration
    public override int Cols { get; }
    Property Value
    Type Description
    int
    Overrides
    ConsoleDriver.Cols
    | Edit this page View Source

    Contents

    Assists with testing, the format is rows, columns and 3 values on the last column: Rune, Attribute and Dirty Flag
    Declaration
    public override int[,,] Contents { get; }
    Property Value
    Type Description
    int[,,]
    Overrides
    ConsoleDriver.Contents
    | Edit this page View Source

    EnableConsoleScrolling

    If false (the default) the height of the Terminal.Gui application (Rows) tracks to the height of the visible console view when the console is resized. In this case scrolling in the console will be disabled and all Rows will remain visible.

    If true then height of the Terminal.Gui application Rows only tracks the height of the visible console view when the console is made larger (the application will only grow in height, never shrink). In this case console scrolling is enabled and the contents (Rows high) will scroll as the console scrolls.

    Declaration
    [Obsolete("This API is deprecated", false)]
    public override bool EnableConsoleScrolling { get; set; }
    Property Value
    Type Description
    bool
    Overrides
    ConsoleDriver.EnableConsoleScrolling
    Remarks
    NOTE: Changes to Windows Terminal prevents this functionality from working. It only really worked on Windows 'conhost' previously.
    | Edit this page View Source

    HeightAsBuffer

    This API is deprecated and has no impact when enabled.
    Declaration
    [Obsolete("This API is deprecated", false)]
    public override bool HeightAsBuffer { get; set; }
    Property Value
    Type Description
    bool
    Overrides
    ConsoleDriver.HeightAsBuffer
    | Edit this page View Source

    Left

    The current left in the terminal.
    Declaration
    public override int Left { get; }
    Property Value
    Type Description
    int
    Overrides
    ConsoleDriver.Left
    | Edit this page View Source

    Rows

    The current number of rows in the terminal.
    Declaration
    public override int Rows { get; }
    Property Value
    Type Description
    int
    Overrides
    ConsoleDriver.Rows
    | Edit this page View Source

    Top

    The current top in the terminal.
    Declaration
    public override int Top { get; }
    Property Value
    Type Description
    int
    Overrides
    ConsoleDriver.Top

    Methods

    | Edit this page View Source

    AddRune(Rune)

    Adds the specified rune to the display at the current cursor position.
    Declaration
    public override void AddRune(Rune rune)
    Parameters
    Type Name Description
    Rune rune Rune to add.
    Overrides
    ConsoleDriver.AddRune(Rune)
    | Edit this page View Source

    AddStr(ustring)

    Adds the str to the display at the cursor position.
    Declaration
    public override void AddStr(ustring str)
    Parameters
    Type Name Description
    ustring str String.
    Overrides
    ConsoleDriver.AddStr(ustring)
    | Edit this page View Source

    CookMouse()

    Enables the cooked event processing from the mouse driver. Not implemented by any driver: See Issue #2300.
    Declaration
    public override void CookMouse()
    Overrides
    ConsoleDriver.CookMouse()
    | Edit this page View Source

    End()

    Ends the execution of the console driver.
    Declaration
    public override void End()
    Overrides
    ConsoleDriver.End()
    | Edit this page View Source

    EnsureCursorVisibility()

    Ensure the cursor visibility
    Declaration
    public override bool EnsureCursorVisibility()
    Returns
    Type Description
    bool true upon success
    Overrides
    ConsoleDriver.EnsureCursorVisibility()
    | Edit this page View Source

    FromVKPacketToKConsoleKeyInfo(ConsoleKeyInfo)

    Declaration
    public ConsoleKeyInfo FromVKPacketToKConsoleKeyInfo(ConsoleKeyInfo consoleKeyInfo)
    Parameters
    Type Name Description
    ConsoleKeyInfo consoleKeyInfo
    Returns
    Type Description
    ConsoleKeyInfo
    | Edit this page View Source

    GetColors(int, out Color, out Color)

    Gets the foreground and background colors based on the value.
    Declaration
    public override bool GetColors(int value, out Color foreground, out Color background)
    Parameters
    Type Name Description
    int value The value.
    Color foreground The foreground.
    Color background The background.
    Returns
    Type Description
    bool
    Overrides
    ConsoleDriver.GetColors(int, out Color, out Color)
    | Edit this page View Source

    GetCursorVisibility(out CursorVisibility)

    Retreive the cursor caret visibility
    Declaration
    public override bool GetCursorVisibility(out CursorVisibility visibility)
    Parameters
    Type Name Description
    CursorVisibility visibility The current CursorVisibility
    Returns
    Type Description
    bool true upon success
    Overrides
    ConsoleDriver.GetCursorVisibility(out CursorVisibility)
    | Edit this page View Source

    Init(Action)

    Initializes the driver
    Declaration
    public override void Init(Action terminalResized)
    Parameters
    Type Name Description
    Action terminalResized Method to invoke when the terminal is resized.
    Overrides
    ConsoleDriver.Init(Action)
    | Edit this page View Source

    MakeAttribute(Color, Color)

    Make the attribute for the foreground and background colors.
    Declaration
    public override Attribute MakeAttribute(Color fore, Color back)
    Parameters
    Type Name Description
    Color fore Foreground.
    Color back Background.
    Returns
    Type Description
    Attribute
    Overrides
    ConsoleDriver.MakeAttribute(Color, Color)
    | Edit this page View Source

    MakeColor(Color, Color)

    Make the Colors for the ColorScheme.
    Declaration
    public override Attribute MakeColor(Color foreground, Color background)
    Parameters
    Type Name Description
    Color foreground The foreground color.
    Color background The background color.
    Returns
    Type Description
    Attribute The attribute for the foreground and background colors.
    Overrides
    ConsoleDriver.MakeColor(Color, Color)
    | Edit this page View Source

    Move(int, int)

    Moves the cursor to the specified column and row.
    Declaration
    public override void Move(int col, int row)
    Parameters
    Type Name Description
    int col Column to move the cursor to.
    int row Row to move the cursor to.
    Overrides
    ConsoleDriver.Move(int, int)
    | Edit this page View Source

    PrepareToRun(MainLoop, Action<KeyEvent>, Action<KeyEvent>, Action<KeyEvent>, Action<MouseEvent>)

    Prepare the driver and set the key and mouse events handlers.
    Declaration
    public override void PrepareToRun(MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
    Parameters
    Type Name Description
    MainLoop mainLoop The main loop.
    Action<KeyEvent> keyHandler The handler for ProcessKey
    Action<KeyEvent> keyDownHandler The handler for key down events
    Action<KeyEvent> keyUpHandler The handler for key up events
    Action<MouseEvent> mouseHandler The handler for mouse events
    Overrides
    ConsoleDriver.PrepareToRun(MainLoop, Action<KeyEvent>, Action<KeyEvent>, Action<KeyEvent>, Action<MouseEvent>)
    | Edit this page View Source

    Refresh()

    Updates the screen to reflect all the changes that have been done to the display buffer
    Declaration
    public override void Refresh()
    Overrides
    ConsoleDriver.Refresh()
    | Edit this page View Source

    ResizeScreen()

    Resizes the clip area when the screen is resized.
    Declaration
    public override void ResizeScreen()
    Overrides
    ConsoleDriver.ResizeScreen()
    | Edit this page View Source

    SendKeys(char, ConsoleKey, bool, bool, bool)

    Allows sending keys without typing on a keyboard.
    Declaration
    public override void SendKeys(char keyChar, ConsoleKey key, bool shift, bool alt, bool control)
    Parameters
    Type Name Description
    char keyChar The character key.
    ConsoleKey key The key.
    bool shift If shift key is sending.
    bool alt If alt key is sending.
    bool control If control key is sending.
    Overrides
    ConsoleDriver.SendKeys(char, ConsoleKey, bool, bool, bool)
    | Edit this page View Source

    SetAttribute(Attribute)

    Selects the specified attribute as the attribute to use for future calls to AddRune and AddString.
    Declaration
    public override void SetAttribute(Attribute c)
    Parameters
    Type Name Description
    Attribute c C.
    Overrides
    ConsoleDriver.SetAttribute(Attribute)
    Remarks
    Implementations should call base.SetAttribute(c).
    | Edit this page View Source

    SetBufferSize(int, int)

    Declaration
    public void SetBufferSize(int width, int height)
    Parameters
    Type Name Description
    int width
    int height
    | Edit this page View Source

    SetColors(ConsoleColor, ConsoleColor)

    Set Colors from limit sets of colors. Not implemented by any driver: See Issue #2300.
    Declaration
    public override void SetColors(ConsoleColor foreground, ConsoleColor background)
    Parameters
    Type Name Description
    ConsoleColor foreground Foreground.
    ConsoleColor background Background.
    Overrides
    ConsoleDriver.SetColors(ConsoleColor, ConsoleColor)
    | Edit this page View Source

    SetColors(short, short)

    Advanced uses - set colors to any pre-set pairs, you would need to init_color that independently with the R, G, B values. Not implemented by any driver: See Issue #2300.
    Declaration
    public override void SetColors(short foregroundColorId, short backgroundColorId)
    Parameters
    Type Name Description
    short foregroundColorId Foreground color identifier.
    short backgroundColorId Background color identifier.
    Overrides
    ConsoleDriver.SetColors(short, short)
    | Edit this page View Source

    SetCursorVisibility(CursorVisibility)

    Change the cursor caret visibility
    Declaration
    public override bool SetCursorVisibility(CursorVisibility visibility)
    Parameters
    Type Name Description
    CursorVisibility visibility The wished CursorVisibility
    Returns
    Type Description
    bool true upon success
    Overrides
    ConsoleDriver.SetCursorVisibility(CursorVisibility)
    | Edit this page View Source

    SetWindowPosition(int, int)

    Declaration
    public void SetWindowPosition(int left, int top)
    Parameters
    Type Name Description
    int left
    int top
    | Edit this page View Source

    SetWindowSize(int, int)

    Declaration
    public void SetWindowSize(int width, int height)
    Parameters
    Type Name Description
    int width
    int height
    | Edit this page View Source

    StartReportingMouseMoves()

    Start of mouse moves.
    Declaration
    public override void StartReportingMouseMoves()
    Overrides
    ConsoleDriver.StartReportingMouseMoves()
    | Edit this page View Source

    StopReportingMouseMoves()

    Stop reporting mouses moves.
    Declaration
    public override void StopReportingMouseMoves()
    Overrides
    ConsoleDriver.StopReportingMouseMoves()
    | Edit this page View Source

    Suspend()

    Suspend the application, typically needs to save the state, suspend the app and upon return, reset the console driver.
    Declaration
    public override void Suspend()
    Overrides
    ConsoleDriver.Suspend()
    | Edit this page View Source

    UncookMouse()

    Disables the cooked event processing from the mouse driver. At startup, it is assumed mouse events are cooked. Not implemented by any driver: See Issue #2300.
    Declaration
    public override void UncookMouse()
    Overrides
    ConsoleDriver.UncookMouse()
    | Edit this page View Source

    UpdateCursor()

    Updates the location of the cursor position
    Declaration
    public override void UpdateCursor()
    Overrides
    ConsoleDriver.UpdateCursor()
    | Edit this page View Source

    UpdateOffScreen()

    Reset and recreate the contents and the driver buffer.
    Declaration
    public override void UpdateOffScreen()
    Overrides
    ConsoleDriver.UpdateOffScreen()
    | Edit this page View Source

    UpdateScreen()

    Redraws the physical screen with the contents that have been queued up via any of the printing commands.
    Declaration
    public override void UpdateScreen()
    Overrides
    ConsoleDriver.UpdateScreen()
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX