Summary
This is the base class for option classes for various commands for
the Mercurial and TortoiseHg client.
- Assembly
- Mercurial
.Net .dll - Namespace
- Mercurial
- Interfaces
- Base Types
-
- object
- Derived Types
graph TD
Base0["object"]-->Type
Interface0["ICommand"]-.->Type
click Interface0 "/Cake.Hg/api/Mercurial/ICommand"
Type["CommandBase<T>"]
class Type type-node
Type-->Derived0["GuiCommandBase<T>"]
click Derived0 "/Cake.Hg/api/Mercurial.Gui/GuiCommandBase_1"
Type-->Derived1["MercurialCommandBase<T>"]
click Derived1 "/Cake.Hg/api/Mercurial/MercurialCommandBase_1"
Syntax
public class CommandBase<T> : ICommand where T : CommandBase<T>
Type Parameters
Name | Description |
---|---|
T |
The actual type descending from CommandBase<T> , used to generate type-correct
methods in this base class.
|
Constructors
Name | Summary |
---|---|
CommandBase |
Initializes a new instance of the CommandBase<T> class.
|
Properties
Name | Value | Summary |
---|---|---|
AdditionalArguments | Collection |
Gets the collection which additional arguments can be added into. This collection
is exposed for extensions, so that they have a place to add all their
extra arguments to the Mercurial command line client.
|
Arguments | IEnumerable |
Gets all the arguments to the
Command , or an
empty array if there are none.
|
Command | string |
Gets the command to execute with the Mercurial command line client.
|
DebugOutput | bool |
Gets or sets a value indicating whether to enable debug output on the command. This should only be used by the command code
itself, never by the user.
|
Observer | I |
Gets or sets the object that will act as an observer of command execution.
|
RawExitCode | int |
Gets the raw exit code from executing the command line client.
|
Raw |
string |
Gets the raw standard error output from executing the command line client.
|
RawStandardOutput | string |
Gets the raw standard output from executing the command line client.
|
Timeout | int |
Gets or sets the timeout to use when executing Mercurial commands, in
seconds. Default is 60.
|
Methods
Name | Value | Summary |
---|---|---|
AddArgument |
void |
Adds the specified argument to the
AdditionalArguments collection,
unless it is already present.
|
After |
void |
This method is called after the command has been executed. You can use this to
clean up after the command execution (like removing temporary files), and to
react to the exit code from the command line client. If the exit code is
considered a failure, this method should throw the correct exception.
|
Before |
void |
This method is called before the command is executed. You can use this to
store temporary files (like a commit message or similar) that the
Arguments refer to, before the command is executed.
|
Cleanup |
void |
Override this method to implement code that will execute after command
line execution.
|
Parse |
void |
This method should parse and store the appropriate execution result output
according to the type of data the command line client would return for
the command.
|
Prepare |
void |
Override this method to implement code that will execute before command
line execution.
|
Throw |
void |
This method should throw the appropriate exception depending on the contents of
the exitCode and standardErrorOutput
parameters, or simply return if the execution is considered successful.
|
Validate |
void |
Validates the command configuration. This method should throw the necessary
exceptions to signal missing or incorrect configuration (like attempting to
add files to the repository without specifying which files to add.)
|
With |
T |
Adds the value to the
AdditionalArguments collection property and
returns this instance.
|
WithObserver |
T |
Sets the
Observer property to the specified value and
returns this instance.
|
WithTimeout |
T |
Sets the
Timeout property to the specified value and
returns this instance.
|