C# Класс Crabwise.CommandWrap.Command

Provides an abstract representation of a command prompt command.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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