C# 클래스 Microsoft.Scripting.Hosting.Shell.CommandLine

Command line hosting service.
파일 보기 프로젝트 열기: jschementi/iron 1 사용 예제들

공개 메소드들

메소드 설명
CommandLine ( ) : System
GetGlobals ( string name ) : IList
GetMemberNames ( string code ) : IList
Run ( ScriptEngine engine, IConsole console, ConsoleOptions options ) : void

Executes the comand line - depending upon the options provided we will either run a single file, a single command, or enter the interactive loop.

Terminate ( int exitCode ) : void

보호된 메소드들

메소드 설명
CreateCommandDispatcher ( ) : ICommandDispatcher
CreateScope ( ) : Scope
ExecuteCommand ( ScriptSource source ) : object
ExecuteCommand ( string command ) : void
GetCommandProperties ( string code ) : ScriptCodeParseResult
GetNextAutoIndentSize ( string text ) : int

Gets the next level for auto-indentation

GetOutputWriter ( bool isErrorOutput ) : TextWriter
Initialize ( ) : void
PrintLogo ( ) : void
ReadLine ( int autoIndentSize ) : string
ReadStatement ( bool &continueInteraction ) : string

Read a statement, which can potentially be a multiple-line statement suite (like a class declaration).

Run ( ) : int

Runs the command line. Languages can override this to provide custom behavior other than: 1. Running a single command 2. Running a file 3. Entering the interactive console loop.

RunCommand ( string command ) : int
RunFile ( string fileName ) : int
RunInteractive ( ) : int

Starts the interactive loop. Performs any initialization necessary before starting the loop and then calls RunInteractiveLoop to start the loop. Returns the exit code when the interactive loop is completed.

TryInteractiveAction ( ) : int?

Attempts to run a single interaction and handle any language-specific exceptions. Base classes can override this and call the base implementation surrounded with their own exception handling. Returns null if successful and execution should continue, or an exit code.

UnhandledException ( Exception e ) : void

비공개 메소드들

메소드 설명
IsFatalException ( Exception e ) : bool
RunFile ( ScriptSource source ) : int
RunInteractiveLoop ( ) : int
RunOneInteraction ( ) : int?

Parses a single interactive command or a set of statements and executes it. Returns null if successful and execution should continue, or the appropiate exit code. We check if the code read is an interactive command or statements is by checking for NewLine If the code contains NewLine, it's a set of statements (most probably from SendToConsole) If the code does not contain a NewLine, it's an interactive command typed by the user at the prompt

Shutdown ( ) : void
TreatAsBlankLine ( string line, int autoIndentSize ) : bool

Private helper function to see if we should treat the current input as a blank link. We do this if we only have auto-indent text.

메소드 상세

CommandLine() 공개 메소드

public CommandLine ( ) : System
리턴 System

CreateCommandDispatcher() 보호된 메소드

protected CreateCommandDispatcher ( ) : ICommandDispatcher
리턴 ICommandDispatcher

CreateScope() 보호된 메소드

protected CreateScope ( ) : Scope
리턴 Microsoft.Scripting.Runtime.Scope

ExecuteCommand() 보호된 메소드

protected ExecuteCommand ( ScriptSource source ) : object
source ScriptSource
리턴 object

ExecuteCommand() 보호된 메소드

protected ExecuteCommand ( string command ) : void
command string
리턴 void

GetCommandProperties() 보호된 메소드

protected GetCommandProperties ( string code ) : ScriptCodeParseResult
code string
리턴 ScriptCodeParseResult

GetGlobals() 공개 메소드

public GetGlobals ( string name ) : IList
name string
리턴 IList

GetMemberNames() 공개 메소드

public GetMemberNames ( string code ) : IList
code string
리턴 IList

GetNextAutoIndentSize() 보호된 메소드

Gets the next level for auto-indentation
protected GetNextAutoIndentSize ( string text ) : int
text string
리턴 int

GetOutputWriter() 보호된 메소드

protected GetOutputWriter ( bool isErrorOutput ) : TextWriter
isErrorOutput bool
리턴 System.IO.TextWriter

Initialize() 보호된 메소드

protected Initialize ( ) : void
리턴 void

PrintLogo() 보호된 메소드

protected PrintLogo ( ) : void
리턴 void

ReadLine() 보호된 메소드

protected ReadLine ( int autoIndentSize ) : string
autoIndentSize int
리턴 string

ReadStatement() 보호된 메소드

Read a statement, which can potentially be a multiple-line statement suite (like a class declaration).
protected ReadStatement ( bool &continueInteraction ) : string
continueInteraction bool Should the console session continue, or did the user indicate /// that it should be terminated?
리턴 string

Run() 보호된 메소드

Runs the command line. Languages can override this to provide custom behavior other than: 1. Running a single command 2. Running a file 3. Entering the interactive console loop.
protected Run ( ) : int
리턴 int

Run() 공개 메소드

Executes the comand line - depending upon the options provided we will either run a single file, a single command, or enter the interactive loop.
public Run ( ScriptEngine engine, IConsole console, ConsoleOptions options ) : void
engine ScriptEngine
console IConsole
options ConsoleOptions
리턴 void

RunCommand() 보호된 메소드

protected RunCommand ( string command ) : int
command string
리턴 int

RunFile() 보호된 메소드

protected RunFile ( string fileName ) : int
fileName string
리턴 int

RunInteractive() 보호된 메소드

Starts the interactive loop. Performs any initialization necessary before starting the loop and then calls RunInteractiveLoop to start the loop. Returns the exit code when the interactive loop is completed.
protected RunInteractive ( ) : int
리턴 int

Terminate() 공개 메소드

public Terminate ( int exitCode ) : void
exitCode int
리턴 void

TryInteractiveAction() 보호된 메소드

Attempts to run a single interaction and handle any language-specific exceptions. Base classes can override this and call the base implementation surrounded with their own exception handling. Returns null if successful and execution should continue, or an exit code.
protected TryInteractiveAction ( ) : int?
리턴 int?

UnhandledException() 보호된 메소드

protected UnhandledException ( Exception e ) : void
e System.Exception
리턴 void