CommandInfoTryCreate Method

Creates an instance of the CommandInfo class only if commandType represents a command type.

Definition

Namespace: Ookii.CommandLine.Commands
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public static CommandInfo? TryCreate(
	Type commandType,
	CommandManager manager
)

Parameters

commandType  Type
The type that implements the subcommand.
manager  CommandManager
The CommandManager that is managing this command.

Return Value

CommandInfo
If the type specified by commandType implements the ICommand interface, has the CommandAttribute attribute, and is not , a CommandInfo class with information about the command; otherwise, .

Exceptions

ArgumentNullExceptioncommandType or manager is .

See Also