C# Class PowerArgs.Cli.RichTextCommandLineReader

A utility that lets you prompt a console user for input in an interactive way. It provides hooks for tab completion, syntax highlighting, history management via the up and down arrows, etc.
Afficher le fichier Open project: adamabdelhamed/PowerArgs Class Usage Examples

Private Properties

Свойство Type Description
DoSyntaxHighlighting void

Méthodes publiques

Méthode Description
IsWriteable ( ConsoleKeyInfo info ) : bool

Determines if the given key is writable text

ReadCommandLine ( ConsoleString initialBuffer = null ) : string[]

Reads a line of text from the console and converts it into a string array that has accounted for escape sequences and quoted string literals.

ReadLine ( ConsoleString initialBuffer = null ) : ConsoleString

Reads a line of text from the console. Any interactions you've configured before calling this method will be in effect.

RegisterHandler ( IKeyHandler handler ) : void

Lets you register a custom key handler. You are responsible for ensuring that each key is only handled by one handler. This method will throw if you try to add a duplicate key handler.

RichTextCommandLineReader ( ) : System

Creates a new reader.

UnregisterHandler ( ConsoleKey key ) : bool

Unregisters the handler for the given key

UnregisterHandler ( IKeyHandler handler ) : void

Unregisters the given key handler from the reader. You should only do this if you're planning on overriding the default handlers, and you should do so with caution.

Private Methods

Méthode Description
DoSyntaxHighlighting ( RichCommandLineContext context ) : void

Method Details

IsWriteable() public static méthode

Determines if the given key is writable text
public static IsWriteable ( ConsoleKeyInfo info ) : bool
info System.ConsoleKeyInfo the key info
Résultat bool

ReadCommandLine() public méthode

Reads a line of text from the console and converts it into a string array that has accounted for escape sequences and quoted string literals.
public ReadCommandLine ( ConsoleString initialBuffer = null ) : string[]
initialBuffer ConsoleString Optionally seed the prompt with an initial value that the end user can modify
Résultat string[]

ReadLine() public méthode

Reads a line of text from the console. Any interactions you've configured before calling this method will be in effect.
public ReadLine ( ConsoleString initialBuffer = null ) : ConsoleString
initialBuffer ConsoleString Optionally seed the prompt with an initial value that the end user can modify
Résultat ConsoleString

RegisterHandler() public méthode

Lets you register a custom key handler. You are responsible for ensuring that each key is only handled by one handler. This method will throw if you try to add a duplicate key handler.
public RegisterHandler ( IKeyHandler handler ) : void
handler IKeyHandler The handler to register
Résultat void

RichTextCommandLineReader() public méthode

Creates a new reader.
public RichTextCommandLineReader ( ) : System
Résultat System

UnregisterHandler() public méthode

Unregisters the handler for the given key
public UnregisterHandler ( ConsoleKey key ) : bool
key ConsoleKey the key to unregister
Résultat bool

UnregisterHandler() public méthode

Unregisters the given key handler from the reader. You should only do this if you're planning on overriding the default handlers, and you should do so with caution.
public UnregisterHandler ( IKeyHandler handler ) : void
handler IKeyHandler The handler to unregister
Résultat void