C# 클래스 ConsoleMenu.CMenu

A console menu structure, comprised of various menu items. To create a menu which displays the current time: var menu = new CMenu (); menu.Add ("time", s => Console.WriteLine (DateTime.UtcNow)); menu.Run ();
상속: CMenuItem
파일 보기 프로젝트 열기: nerai/CMenu 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ImmediateMenuMode bool
PromptCharacter string

공개 메소드들

메소드 설명
CMenu ( string selector = null, bool addDefaultItems = true ) : System

Create a new CMenu.

Iff no selector was specified, the menu will initially contain the following commands: help quit

Execute ( string arg ) : void

If this item gets selected in its parent menu, run it as a menu itself.

Quit ( ) : void

Stops menu processing. Control will return to the parent menu.

Processing can be restarted by calling Run again.

Run ( ) : void

Start console prompting and processing.

Immediately before processing begins, the event OnRun is called. Immediately after processing has ended, the event OnQuit called.

메소드 상세

CMenu() 공개 메소드

Create a new CMenu.

Iff no selector was specified, the menu will initially contain the following commands: help quit

public CMenu ( string selector = null, bool addDefaultItems = true ) : System
selector string
addDefaultItems bool
리턴 System

Execute() 공개 메소드

If this item gets selected in its parent menu, run it as a menu itself.
public Execute ( string arg ) : void
arg string /// If an additional nonnull, nonwhitespace argument is given, it will be executed /// in the local menu context immediately. ///
리턴 void

Quit() 공개 메소드

Stops menu processing. Control will return to the parent menu.

Processing can be restarted by calling Run again.

public Quit ( ) : void
리턴 void

Run() 공개 메소드

Start console prompting and processing.

Immediately before processing begins, the event OnRun is called. Immediately after processing has ended, the event OnQuit called.

public Run ( ) : void
리턴 void

프로퍼티 상세

ImmediateMenuMode 공개적으로 프로퍼티

In immediate mode, instead of typing the name of a command, only a number associated with each command is entered. All available commands and their numbers will be displayed at any opportunity.
public bool ImmediateMenuMode
리턴 bool

PromptCharacter 공개적으로 프로퍼티

The string which is displayed in front of every prompt (i.e. query for user input).

Set to null if no prompt should be displayed.

public string PromptCharacter
리턴 string