C# Class Crabwise.CommandWrap.SyntaxBuilder

Builds a syntactical representation of a Command object.
Mostra file Open project: CrabwiseStudios/CommandWrap Class Usage Examples

Public Methods

Method Description
SyntaxBuilder ( Command command ) : System

Initializes a new instance of the SyntaxBuilder class.

ToString ( ) : string

Gets the complete syntax for the command.

The string returned by this method is equivalent to what would be entered in a command prompt.

Private Methods

Method Description
BuildCommandFromType ( Type commandType, Command command ) : void

Recursively builds the syntax for the command.

This method recursively works its way up a Command object's inheritance hierarchy. It stops when the next base class is not a subclass of Command. This allows for nested commands to be built.

BuildSyntax ( ) : void

Checks to make sure the provided Command has a CommandSyntaxAttribute and then calls SyntaxBuilder.BuildCommandFromType

GetSyntaxAttribute ( MemberInfo memberInfo ) : SyntaxAttribute

Gets a SyntaxAttribute from a member.

Method Details

SyntaxBuilder() public method

Initializes a new instance of the SyntaxBuilder class.
public SyntaxBuilder ( Command command ) : System
command Command Command from which to build the syntax.
return System

ToString() public method

Gets the complete syntax for the command.
The string returned by this method is equivalent to what would be entered in a command prompt.
public ToString ( ) : string
return string