C# 클래스 IrcShark.Extensions.Terminal.History

The History saves a list of typed commands on the console and provides methods to switch through the saved commands.
This code bases on Miguel de Icaza's ([email protected]) LineEditor from the mono project. It was changed to fit the needs of IrcShark and its coding standards.
파일 보기 프로젝트 열기: hapm/IrcShark 1 사용 예제들

공개 메소드들

메소드 설명
Accept ( string s ) : void

Overrides the lastly added history item.

Append ( string s ) : void

Appends a value to the history.

CursorToEnd ( ) : void

Moves the cursor to the end of the history.

History ( int size ) : System

Initializes a new instance of the History class.

History ( int size, string savedHistory ) : System

Initializes a new instance of the History class.

Next ( ) : string

Moves the cursor to the next item if possible, and returns it.

NextAvailable ( ) : bool

Checks if there is a next item after the current item under the cursor.

Previous ( ) : string

Moves the cursor to the previous item if possible, and returns it.

PreviousAvailable ( ) : bool

Checks if there is a previous item before the current item under the cursor.

RemoveLast ( ) : void

Removes the last item that was added to the History.

SearchBackward ( string term ) : string

Searches a given term in the history backwards, from newest to oldest command.

Update ( string s ) : void

Updates the current cursor location with the string, to support editing of history items.

For the current line to participate, an Append must be done before.

비공개 메소드들

메소드 설명
Close ( ) : void

메소드 상세

Accept() 공개 메소드

Overrides the lastly added history item.
public Accept ( string s ) : void
s string The new value to add.
리턴 void

Append() 공개 메소드

Appends a value to the history.
public Append ( string s ) : void
s string The value to append.
리턴 void

CursorToEnd() 공개 메소드

Moves the cursor to the end of the history.
public CursorToEnd ( ) : void
리턴 void

History() 공개 메소드

Initializes a new instance of the History class.
Thrown if size is smaller than 1.
public History ( int size ) : System
size int The number of commands, this history instance can save.
리턴 System

History() 공개 메소드

Initializes a new instance of the History class.
Thrown if size is smaller than 1 or than the length of the savedHistory array.
public History ( int size, string savedHistory ) : System
size int The number of commands, this history instance can save.
savedHistory string An array of saved commands, that should be loaded to the History on initialisation.
리턴 System

Next() 공개 메소드

Moves the cursor to the next item if possible, and returns it.
public Next ( ) : string
리턴 string

NextAvailable() 공개 메소드

Checks if there is a next item after the current item under the cursor.
public NextAvailable ( ) : bool
리턴 bool

Previous() 공개 메소드

Moves the cursor to the previous item if possible, and returns it.
public Previous ( ) : string
리턴 string

PreviousAvailable() 공개 메소드

Checks if there is a previous item before the current item under the cursor.
public PreviousAvailable ( ) : bool
리턴 bool

RemoveLast() 공개 메소드

Removes the last item that was added to the History.
public RemoveLast ( ) : void
리턴 void

SearchBackward() 공개 메소드

Searches a given term in the history backwards, from newest to oldest command.
public SearchBackward ( string term ) : string
term string The term to search for.
리턴 string

Update() 공개 메소드

Updates the current cursor location with the string, to support editing of history items.
For the current line to participate, an Append must be done before.
public Update ( string s ) : void
s string The new value for the history item at the current location.
리턴 void