PSHostRawUserInterface PSHostRawUserInterface PSHostRawUserInterface PSHostRawUserInterface Class

Definition

Defines the lowest-level user interface functions that an interactive application hosting an MSH Runspace can choose to implement if it wants to support any cmdlet that does character-mode interaction with the user.

public ref class PSHostRawUserInterface abstract
public abstract class PSHostRawUserInterface
type PSHostRawUserInterface = class
Public MustInherit Class PSHostRawUserInterface
Inheritance
PSHostRawUserInterfacePSHostRawUserInterfacePSHostRawUserInterfacePSHostRawUserInterface

Remarks

It models an 2-dimensional grid of cells called a Buffer. A buffer has a visible rectangular region, called a window.

Each cell of the grid has a character, a foreground color, and a background color. When the buffer has input focus, it

shows a cursor positioned in one cell. Keystrokes can be read from the buffer and optionally echoed at the current

cursor position.

Constructors

PSHostRawUserInterface() PSHostRawUserInterface() PSHostRawUserInterface() PSHostRawUserInterface()

Protected constructor which does nothing. Provided per .Net design guidelines section 4.3.1

Properties

BackgroundColor BackgroundColor BackgroundColor BackgroundColor

Gets or sets the color used to render the background behind characters on the screen buffer. Each character cell in the screen buffer can have a separate background color.

BufferSize BufferSize BufferSize BufferSize

Gets or sets the current size of the screen buffer, measured in character cells.

CursorPosition CursorPosition CursorPosition CursorPosition

Gets or sets the cursor position in the screen buffer. The view window always adjusts it's location over the screen buffer such that the cursor is always visible.

CursorSize CursorSize CursorSize CursorSize

Gets or sets the cursor size as a percentage 0..100.

ForegroundColor ForegroundColor ForegroundColor ForegroundColor

Gets or sets the color used to render characters on the screen buffer. Each character cell in the screen buffer can have a separate foreground color.

KeyAvailable KeyAvailable KeyAvailable KeyAvailable

A non-blocking call to examine if a keystroke is waiting in the input buffer.

MaxPhysicalWindowSize MaxPhysicalWindowSize MaxPhysicalWindowSize MaxPhysicalWindowSize

Gets the largest window possible for the current font and display hardware, ignoring the current buffer dimensions. In other words, the dimensions of the largest window that could be rendered in the current display, if the buffer was at least as large.

MaxWindowSize MaxWindowSize MaxWindowSize MaxWindowSize

Gets the size of the largest window possible for the current buffer, current font, and current display hardware. The view window cannot be larger than the screen buffer or the current display (the display the window is rendered on).

WindowPosition WindowPosition WindowPosition WindowPosition

Gets or sets position of the view window relative to the screen buffer, in characters. (0,0) is the upper left of the screen buffer.

WindowSize WindowSize WindowSize WindowSize

Gets or sets the current view window size, measured in character cells. The window size cannot be larger than the dimensions returned by MaxPhysicalWindowSize.

WindowTitle WindowTitle WindowTitle WindowTitle

Gets or sets the titlebar text of the current view window.

Methods

FlushInputBuffer() FlushInputBuffer() FlushInputBuffer() FlushInputBuffer()

Resets the keyboard input buffer.

GetBufferContents(Rectangle) GetBufferContents(Rectangle) GetBufferContents(Rectangle) GetBufferContents(Rectangle)

Extracts a rectangular region of the screen buffer.

LengthInBufferCells(Char) LengthInBufferCells(Char) LengthInBufferCells(Char) LengthInBufferCells(Char)

Determines the number of BufferCells a character occupies.

LengthInBufferCells(String) LengthInBufferCells(String) LengthInBufferCells(String) LengthInBufferCells(String)

Determines the number of BufferCells a string occupies.

LengthInBufferCells(String, Int32) LengthInBufferCells(String, Int32) LengthInBufferCells(String, Int32) LengthInBufferCells(String, Int32)

Determines the number of BufferCells a substring of a string occupies.

NewBufferCellArray(Size, BufferCell) NewBufferCellArray(Size, BufferCell) NewBufferCellArray(Size, BufferCell) NewBufferCellArray(Size, BufferCell)

Same as NewBufferCellArray(Int32, Int32, BufferCell)

NewBufferCellArray(Int32, Int32, BufferCell) NewBufferCellArray(Int32, Int32, BufferCell) NewBufferCellArray(Int32, Int32, BufferCell) NewBufferCellArray(Int32, Int32, BufferCell)

Creates a 2D array of BufferCells by examining contents.Character.

NewBufferCellArray(String[], ConsoleColor, ConsoleColor) NewBufferCellArray(String[], ConsoleColor, ConsoleColor) NewBufferCellArray(String[], ConsoleColor, ConsoleColor) NewBufferCellArray(String[], ConsoleColor, ConsoleColor)

Creates a two dimensional array of BufferCells by examining each character in contents.

ReadKey() ReadKey() ReadKey() ReadKey()

Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Same as ReadKey(ReadKeyOptions.IncludeKeyDown)

ReadKey(ReadKeyOptions) ReadKey(ReadKeyOptions) ReadKey(ReadKeyOptions) ReadKey(ReadKeyOptions)

Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Either one of ReadKeyOptions.IncludeKeyDown and ReadKeyOptions.IncludeKeyUp or both must be specified.

ScrollBufferContents(Rectangle, Coordinates, Rectangle, BufferCell) ScrollBufferContents(Rectangle, Coordinates, Rectangle, BufferCell) ScrollBufferContents(Rectangle, Coordinates, Rectangle, BufferCell) ScrollBufferContents(Rectangle, Coordinates, Rectangle, BufferCell)

Scroll a region of the screen buffer.

SetBufferContents(Coordinates, BufferCell[,]) SetBufferContents(Coordinates, BufferCell[,]) SetBufferContents(Coordinates, BufferCell[,]) SetBufferContents(Coordinates, BufferCell[,])

Copies the BufferCell array into the screen buffer at the given origin, clipping such that cells in the array that would fall outside the screen buffer are ignored.

SetBufferContents(Rectangle, BufferCell) SetBufferContents(Rectangle, BufferCell) SetBufferContents(Rectangle, BufferCell) SetBufferContents(Rectangle, BufferCell)

Copies a given character to all of the character cells in the screen buffer with the indicated colors.

Applies to

See Also