C# Класс PowerArgs.Cli.RichCommandLineContext

A class that provides context for consumers of the RichTextCommandLineReader
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GetQuoteStatus QuoteStatus
IsCursorOnToken bool
Reset void
RichCommandLineContext System

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

Метод Описание
ClearConsole ( ) : void

Clears the console

CompleteCurrentToken ( Token currentToken, ConsoleString completion ) : void

Performs an auto complete of the given token.

GetBufferSubstringFromToken ( Token t ) : ConsoleString

Returns the portion of the buffer represented by the given token

RefreshConsole ( int leftAdjust, int topAdjust ) : void

Rewrites the console using the latest values in the Buffer, preserving the cursor position with an optional adjustment.

RefreshTokenInfo ( bool force = false ) : void

Runs the tokenizer if it hasn't already been run on the current key press. You can pass a force flag if you want to force the tokenizer to run. You would need to do this only if you've manually changed the buffer within your handler.

ReplaceConsole ( ConsoleString newBuffer ) : void

Rewrites the console using the latest values in the Buffer and moves the cursor to the end of the line.

WriteCharacterForPressedKey ( ) : void

Takes the value of KeyPressed.KeyChar and writes it to the console in the current buffer position.

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

Метод Описание
GetQuoteStatus ( List chars, int startPosition ) : QuoteStatus
IsCursorOnToken ( Token t ) : bool
Reset ( ) : void
RichCommandLineContext ( ConsoleHistoryManager historyManager ) : System

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

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

Clears the console
public ClearConsole ( ) : void
Результат void

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

Performs an auto complete of the given token.
public CompleteCurrentToken ( Token currentToken, ConsoleString completion ) : void
currentToken Token the token to complete
completion ConsoleString the completed token. Note that it is not required that the completion string starts with the current token value, though it usually does.
Результат void

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

Returns the portion of the buffer represented by the given token
public GetBufferSubstringFromToken ( Token t ) : ConsoleString
t Token the token whose position to use to look into the buffer
Результат ConsoleString

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

Rewrites the console using the latest values in the Buffer, preserving the cursor position with an optional adjustment.
public RefreshConsole ( int leftAdjust, int topAdjust ) : void
leftAdjust int Adjusts the left cursor position by the desired amound. If you want the cursor to stay where it was then use 0.
topAdjust int Adjusts the top cursor position by the desired amound. If you want the cursor to stay where it was then use 0.
Результат void

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

Runs the tokenizer if it hasn't already been run on the current key press. You can pass a force flag if you want to force the tokenizer to run. You would need to do this only if you've manually changed the buffer within your handler.
public RefreshTokenInfo ( bool force = false ) : void
force bool If true, then the tokenizer is run no matter what. If false, the tokenizer only runs if it hasn't yet run on this keystroke.
Результат void

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

Rewrites the console using the latest values in the Buffer and moves the cursor to the end of the line.
public ReplaceConsole ( ConsoleString newBuffer ) : void
newBuffer ConsoleString The new line of text that will replace the current buffer.
Результат void

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

Takes the value of KeyPressed.KeyChar and writes it to the console in the current buffer position.
public WriteCharacterForPressedKey ( ) : void
Результат void