C# Class Commander.UI.Controls.Text.CommanderTextBox

Inheritance: System.Windows.Forms.RichTextBox, IClipboardActions
Afficher le fichier Open project: SneWs/Commander

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

AppendOutput() public méthode

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].
Résultat void

ClearOutput() public méthode

Clears the output.
public ClearOutput ( ) : void
Résultat void

CommanderTextBox() public méthode

public CommanderTextBox ( string prompt ) : System
prompt string
Résultat System

CommanderTextBox() public méthode

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
Résultat System

Copy() public méthode

Copies the current selection in the text box to the Clipboard.
public Copy ( ) : void
Résultat void

GetCurrentLine() public méthode

Returns the current line the carret is on
public GetCurrentLine ( ) : int
Résultat int

GetCurrentLineStartPosition() protected méthode

Get's the starting char index for a line based on if a prompt is present or not.
protected GetCurrentLineStartPosition ( ) : int
Résultat int

GetCurrentLineString() public méthode

Returns the user written input string that's on the current line.
public GetCurrentLineString ( int actualStartIndex ) : string
actualStartIndex int Actual index of the start.
Résultat string

GoToLineEnd() protected méthode

Moves the carret to the last line and the last written character + 1
protected GoToLineEnd ( ) : void
Résultat void

GoToLineStart() protected méthode

Moves the carret to the last line and the first written character after the prompt - 1
protected GoToLineStart ( ) : void
Résultat void

IsCarretOnLastLine() protected méthode

protected IsCarretOnLastLine ( ) : bool
Résultat bool

OnKeyDown() protected méthode

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.
Résultat void

Paste() public méthode

Replaces the current selection in the text box with the contents of the Clipboard.
public Paste ( ) : void
Résultat void

Paste() public méthode

public Paste ( string text ) : void
text string
Résultat void

PlaceCarretOnLastLine() protected méthode

Places the carret on last line.
protected PlaceCarretOnLastLine ( ) : void
Résultat void

ReplaceCurrentLineWith() public méthode

public ReplaceCurrentLineWith ( string newText ) : void
newText string
Résultat void

ScrollToBottom() public méthode

Scrolls to bottom of text box.
public ScrollToBottom ( ) : void
Résultat void

UpdatePosition() public méthode

Updates the position of the carred and makes sure that the text box is scrolled to the bottom.
public UpdatePosition ( ) : void
Résultat void