C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
DoSyntaxHighlighting void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
DoSyntaxHighlighting ( RichCommandLineContext context ) : void

Описание методов

IsWriteable() публичный статический Метод

Determines if the given key is writable text
public static IsWriteable ( ConsoleKeyInfo info ) : bool
info System.ConsoleKeyInfo the key info
Результат bool

ReadCommandLine() публичный Метод

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
Результат string[]

ReadLine() публичный Метод

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
Результат ConsoleString

RegisterHandler() публичный Метод

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
Результат void

RichTextCommandLineReader() публичный Метод

Creates a new reader.
public RichTextCommandLineReader ( ) : System
Результат System

UnregisterHandler() публичный Метод

Unregisters the handler for the given key
public UnregisterHandler ( ConsoleKey key ) : bool
key ConsoleKey the key to unregister
Результат bool

UnregisterHandler() публичный Метод

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
Результат void