CommandFactory

Implements a command factory for creating command.

Namespace:
Inetdev.CLI
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
Yes
Inherits from:
System.Object

Methods

Create

Creates a new instance of a commnad with the specified name.

Signature:
public ICommand Create(name)
Returns

An instance of an ICommand for the specified name.

Parameters
Name Type Summary
name String The name of the command to create.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
InvalidOperationException Thrown when the command name is not valid.

CreateCommands

Creates an array of supported commands.

Signature:
public ICommand[] CreateCommands()
Returns

An array of commands.

Exceptions
Type Summary
InvalidOperationException Thrown when the command list is empty.

SetCommandList

Sets the list of command names.

Signature:
public Void SetCommandList(commandList)
Parameters
Name Type Summary
commandList String[] A list of command names.
Exceptions
Type Summary
ArgumentNullException Thrown when commandList is null.
ArgumentException Thrown when commandList is an empty array.