C# Класс Commander.UI.Controls.Text.CommanderTextBox

Наследование: System.Windows.Forms.RichTextBox, IClipboardActions
Показать файл Открыть проект

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

Метод Описание
AppendOutput ( string output, bool newLine = false, bool addPrompt = false, Color textColor = null, bool skipStyle = true ) : void

Appends the output to the text box applying color etc according to the call.

ClearOutput ( ) : void

Clears the output.

CommanderTextBox ( string prompt ) : System
CommanderTextBox ( string prompt, IShellStatus shellStatus ) : System

Initializes a new instance of the CommanderTextBox class.

Copy ( ) : void

Copies the current selection in the text box to the Clipboard.

GetCurrentLine ( ) : int

Returns the current line the carret is on

GetCurrentLineString ( int actualStartIndex ) : string

Returns the user written input string that's on the current line.

Paste ( ) : void

Replaces the current selection in the text box with the contents of the Clipboard.

Paste ( string text ) : void
ReplaceCurrentLineWith ( string newText ) : void
ScrollToBottom ( ) : void

Scrolls to bottom of text box.

UpdatePosition ( ) : void

Updates the position of the carred and makes sure that the text box is scrolled to the bottom.

Защищенные методы

Метод Описание
GetCurrentLineStartPosition ( ) : int

Get's the starting char index for a line based on if a prompt is present or not.

GoToLineEnd ( ) : void

Moves the carret to the last line and the last written character + 1

GoToLineStart ( ) : void

Moves the carret to the last line and the first written character after the prompt - 1

IsCarretOnLastLine ( ) : bool
OnKeyDown ( KeyEventArgs e ) : void

Raises the E:System.Windows.Forms.Control.KeyDown event.

PlaceCarretOnLastLine ( ) : void

Places the carret on last line.

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

Метод Описание
HandleAutoComplete ( ) : bool

Handles the auto complete of file system entries. Logic: When a user presses TAB, it will automatically show the next item available in that folder in the prompt. For ex. cd T|TAB| could complete with Treasure if Treasure is a file or folder in the current working path

HandleControlKeyActions ( KeyEventArgs e, int caretPosition ) : void

Handles the control key actions.

HandleKeyNavigationLeft ( KeyEventArgs e, int caretPosition ) : void

Handles the key navigation going left.

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

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

Appends the output to the text box applying color etc according to the call.
public AppendOutput ( string output, bool newLine = false, bool addPrompt = false, Color textColor = null, bool skipStyle = true ) : void
output string The output.
newLine bool if set to true [new line].
addPrompt bool
textColor Color Color of the text.
skipStyle bool if set to true [skip style].
Результат void

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

Clears the output.
public ClearOutput ( ) : void
Результат void

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

public CommanderTextBox ( string prompt ) : System
prompt string
Результат System

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

Initializes a new instance of the CommanderTextBox class.
public CommanderTextBox ( string prompt, IShellStatus shellStatus ) : System
prompt string The prompt.
shellStatus IShellStatus The shell status ref
Результат System

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

Copies the current selection in the text box to the Clipboard.
public Copy ( ) : void
Результат void

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

Returns the current line the carret is on
public GetCurrentLine ( ) : int
Результат int

GetCurrentLineStartPosition() защищенный Метод

Get's the starting char index for a line based on if a prompt is present or not.
protected GetCurrentLineStartPosition ( ) : int
Результат int

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

Returns the user written input string that's on the current line.
public GetCurrentLineString ( int actualStartIndex ) : string
actualStartIndex int Actual index of the start.
Результат string

GoToLineEnd() защищенный Метод

Moves the carret to the last line and the last written character + 1
protected GoToLineEnd ( ) : void
Результат void

GoToLineStart() защищенный Метод

Moves the carret to the last line and the first written character after the prompt - 1
protected GoToLineStart ( ) : void
Результат void

IsCarretOnLastLine() защищенный Метод

protected IsCarretOnLastLine ( ) : bool
Результат bool

OnKeyDown() защищенный Метод

Raises the E:System.Windows.Forms.Control.KeyDown event.
protected OnKeyDown ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs A that contains the event data.
Результат void

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

Replaces the current selection in the text box with the contents of the Clipboard.
public Paste ( ) : void
Результат void

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

public Paste ( string text ) : void
text string
Результат void

PlaceCarretOnLastLine() защищенный Метод

Places the carret on last line.
protected PlaceCarretOnLastLine ( ) : void
Результат void

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

public ReplaceCurrentLineWith ( string newText ) : void
newText string
Результат void

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

Scrolls to bottom of text box.
public ScrollToBottom ( ) : void
Результат void

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

Updates the position of the carred and makes sure that the text box is scrolled to the bottom.
public UpdatePosition ( ) : void
Результат void