C# 클래스 PowerArgs.ContextAssistSearch

A context assist provider that lets a user search for an option. The class is abstract. Implementors just need to define the search implementation and this class will do the rest.
상속: IContextAssistProvider
파일 보기 프로젝트 열기: adamabdelhamed/PowerArgs

보호된 프로퍼티들

프로퍼티 타입 설명
parentReaderContext RichCommandLineContext

공개 메소드들

메소드 설명
CanAssist ( RichCommandLineContext parentContext ) : bool

Always returns true. When overrided in a derived class the derived class can provide custom logic to determine whether or not this assist provider can assist.

ClearMenu ( RichCommandLineContext notUsed ) : void

Clears the menu from the console

ContextAssistSearch ( ) : System

Initializes the search assist class

DrawMenu ( RichCommandLineContext parentContext ) : ContextAssistResult

Writes the prompt message and takes over the console until the user makes a selection or cancels via the escape key. This method never returns a NoOp result.

OnKeyboardInput ( RichCommandLineContext parentReaderContext, ConsoleKeyInfo keyPress ) : ContextAssistResult

This is not implemented because this assist provider always takes over the console during the draw menu.

Search ( IConsoleProvider console = null, bool allowCancel = true ) : ContextAssistSearchResult

Performs a standalone search and cleans up the menu at the end.

보호된 메소드들

메소드 설명
GetResults ( string searchString ) : List

When implemented in the derived class, gets search results that match the search string. This ONLY gets called if SupportsAsync returns false.

GetResultsAsync ( string searchString ) : Task>

When implemented in the derived class, gets search results that match the search string asynchronously. This ONLY gets called if SupportsAsync returns true.

비공개 메소드들

메소드 설명
DoSearch ( string searchString ) : void
DoSearchInternal ( RichCommandLineContext parentContext, IConsoleProvider standaloneConsole, bool allowCancel ) : void
RedrawSearchResults ( ) : void
_MoveSelectedIndex ( int amount ) : void
_SearchReader_HandleEnterKey ( RichCommandLineContext searchReaderContext ) : void
_SearchReader_HandleKeyPressed ( RichCommandLineContext searchReaderContext ) : void

메소드 상세

CanAssist() 공개 메소드

Always returns true. When overrided in a derived class the derived class can provide custom logic to determine whether or not this assist provider can assist.
public CanAssist ( RichCommandLineContext parentContext ) : bool
parentContext RichCommandLineContext context about the parent reader that we may be assisting
리턴 bool

ClearMenu() 공개 메소드

Clears the menu from the console
public ClearMenu ( RichCommandLineContext notUsed ) : void
notUsed RichCommandLineContext
리턴 void

ContextAssistSearch() 공개 메소드

Initializes the search assist class
public ContextAssistSearch ( ) : System
리턴 System

DrawMenu() 공개 메소드

Writes the prompt message and takes over the console until the user makes a selection or cancels via the escape key. This method never returns a NoOp result.
public DrawMenu ( RichCommandLineContext parentContext ) : ContextAssistResult
parentContext RichCommandLineContext context about the parent reader that we are assisting
리턴 ContextAssistResult

GetResults() 보호된 추상적인 메소드

When implemented in the derived class, gets search results that match the search string. This ONLY gets called if SupportsAsync returns false.
protected abstract GetResults ( string searchString ) : List
searchString string the search string entered by the user
리턴 List

GetResultsAsync() 보호된 추상적인 메소드

When implemented in the derived class, gets search results that match the search string asynchronously. This ONLY gets called if SupportsAsync returns true.
protected abstract GetResultsAsync ( string searchString ) : Task>
searchString string the search string entered by the user
리턴 Task>

OnKeyboardInput() 공개 메소드

This is not implemented because this assist provider always takes over the console during the draw menu.
public OnKeyboardInput ( RichCommandLineContext parentReaderContext, ConsoleKeyInfo keyPress ) : ContextAssistResult
parentReaderContext RichCommandLineContext not implemented
keyPress System.ConsoleKeyInfo not implemented
리턴 ContextAssistResult

Search() 공개 메소드

Performs a standalone search and cleans up the menu at the end.
public Search ( IConsoleProvider console = null, bool allowCancel = true ) : ContextAssistSearchResult
console IConsoleProvider Optionally choose a custom console target
allowCancel bool if true, users can cancel the search by pressing the escape key. If false, the escape key does nothing.
리턴 ContextAssistSearchResult

프로퍼티 상세

parentReaderContext 보호되어 있는 프로퍼티

context about the parent reader that is only populated when used by a parent reader.
protected RichCommandLineContext parentReaderContext
리턴 RichCommandLineContext