C# 클래스 Crabwise.CommandWrap.Command

Provides an abstract representation of a command prompt command.
파일 보기 프로젝트 열기: CrabwiseStudios/CommandWrap 1 사용 예제들

공개 메소드들

메소드 설명
CancelAsync ( ) : void

Cancels the running command. Throws an exception if called on a command that is not executing.

CloseStandardInput ( ) : void

Closes the standard input to this command.

Execute ( ) : int

Executes this command with the default CommandStartInfo for this Command.

The default CommandStartInfo options can be set by deriving from this class and then overriding the Command.DefaultCommandStartInfo property.

Execute ( CommandStartInfo startInfo ) : int

Uses a CommandStartInfo object to execute this command.

ExecuteAsync ( ) : void

Executes the command with default starting parameters.

ExecuteAsync ( CommandStartInfo startInfo ) : void

Executes the command with custom starting parameters.

GetSyntax ( ) : string

Gets the command prompt String representation for this Command.

WaitForExit ( ) : void
WriteLineToStandardIn ( string input ) : void

Writes a System.String followed by a newline to the standard input of this command.

This method can only be used after Command.Execute() has been called.

WriteToStandardIn ( ICollection input ) : void

Writes a collection of strings to the standard input of this command.

This method can only be used after Command.Execute() has been called.

WriteToStandardIn ( string input ) : void

Writes a System.String to the standard input of this command.

This method can only be used after Command.Execute() has been called.

보호된 메소드들

메소드 설명
OnCommandStarting ( CommandStartingEventArgs e ) : void
OnErrorOutputWritten ( string outputLine ) : void
OnExecuteCompleted ( ) : void

Called when the command has finished running.

OnStandardOutputWritten ( string outputLine ) : void

비공개 메소드들

메소드 설명
CleanupProcess ( ) : int

Handles all the finishing tasks within the command.

GetCommandSyntaxAttribute ( ) : CommandSyntaxAttribute

Gets the CommandSyntaxAttribute that adorns this command.

This method throws a SyntaxException if it cannot find a CommandSyntaxAttribute. This is generally wanted behavior since all classes implementing Command are required to have this attribute.

ProcessExited ( object sender, EventArgs e ) : void
StartProcess ( CommandStartInfo startInfo ) : void

Starts the process with customized starting information

메소드 상세

CancelAsync() 공개 메소드

Cancels the running command. Throws an exception if called on a command that is not executing.
public CancelAsync ( ) : void
리턴 void

CloseStandardInput() 공개 메소드

Closes the standard input to this command.
public CloseStandardInput ( ) : void
리턴 void

Execute() 공개 메소드

Executes this command with the default CommandStartInfo for this Command.
The default CommandStartInfo options can be set by deriving from this class and then overriding the Command.DefaultCommandStartInfo property.
public Execute ( ) : int
리턴 int

Execute() 공개 메소드

Uses a CommandStartInfo object to execute this command.
public Execute ( CommandStartInfo startInfo ) : int
startInfo CommandStartInfo Specifies how to execute this command.
리턴 int

ExecuteAsync() 공개 메소드

Executes the command with default starting parameters.
public ExecuteAsync ( ) : void
리턴 void

ExecuteAsync() 공개 메소드

Executes the command with custom starting parameters.
public ExecuteAsync ( CommandStartInfo startInfo ) : void
startInfo CommandStartInfo The CommandStartInfo object that defines how the command should start
리턴 void

GetSyntax() 공개 메소드

Gets the command prompt String representation for this Command.
public GetSyntax ( ) : string
리턴 string

OnCommandStarting() 보호된 메소드

protected OnCommandStarting ( CommandStartingEventArgs e ) : void
e CommandStartingEventArgs
리턴 void

OnErrorOutputWritten() 보호된 메소드

protected OnErrorOutputWritten ( string outputLine ) : void
outputLine string
리턴 void

OnExecuteCompleted() 보호된 메소드

Called when the command has finished running.
protected OnExecuteCompleted ( ) : void
리턴 void

OnStandardOutputWritten() 보호된 메소드

protected OnStandardOutputWritten ( string outputLine ) : void
outputLine string
리턴 void

WaitForExit() 공개 메소드

public WaitForExit ( ) : void
리턴 void

WriteLineToStandardIn() 공개 메소드

Writes a System.String followed by a newline to the standard input of this command.
This method can only be used after Command.Execute() has been called.
public WriteLineToStandardIn ( string input ) : void
input string to write.
리턴 void

WriteToStandardIn() 공개 메소드

Writes a collection of strings to the standard input of this command.
This method can only be used after Command.Execute() has been called.
public WriteToStandardIn ( ICollection input ) : void
input ICollection of strings to write.
리턴 void

WriteToStandardIn() 공개 메소드

Writes a System.String to the standard input of this command.
This method can only be used after Command.Execute() has been called.
public WriteToStandardIn ( string input ) : void
input string to write.
리턴 void