Show / Hide Table of Contents

Class CommandBase

Base class for all command implementations

Inheritance
object
CommandBase
AsynchronousCommand
SynchronousCommand
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.CommandsFramework
Assembly: Benday.CommandsFramework.dll
Syntax
public abstract class CommandBase

Constructors

| Edit this page View Source

CommandBase(CommandExecutionInfo, ITextOutputProvider)

Constructor

Declaration
public CommandBase(CommandExecutionInfo info, ITextOutputProvider outputProvider)
Parameters
Type Name Description
CommandExecutionInfo info

Execution information for the requested command

ITextOutputProvider outputProvider

Output provider

Exceptions
Type Condition
ArgumentNullException

Fields

| Edit this page View Source

_OutputProvider

Declaration
protected readonly ITextOutputProvider _OutputProvider
Field Value
Type Description
ITextOutputProvider

Properties

| Edit this page View Source

Arguments

Arguments and values for the command

Declaration
protected ArgumentCollection Arguments { get; }
Property Value
Type Description
ArgumentCollection
| Edit this page View Source

Description

Human readable description of this command

Declaration
public string Description { get; }
Property Value
Type Description
string
| Edit this page View Source

ExecutionInfo

Property for accessing the raw execution info for the command

Declaration
public CommandExecutionInfo ExecutionInfo { get; }
Property Value
Type Description
CommandExecutionInfo

Methods

| Edit this page View Source

DisplayUsage()

Displays the command usage description

Declaration
protected virtual void DisplayUsage()
| Edit this page View Source

DisplayUsage(StringBuilder)

Adds the command usage description to the provided string builder

Declaration
protected void DisplayUsage(StringBuilder builder)
Parameters
Type Name Description
StringBuilder builder

StringBuilder instance

| Edit this page View Source

DisplayValidationSummary(List<IArgument>)

Creates and displays the validation summary when there are failed argument validations

Declaration
protected virtual void DisplayValidationSummary(List<IArgument> invalidArguments)
Parameters
Type Name Description
List<IArgument> invalidArguments

Collection of invalid arguments

| Edit this page View Source

GetArguments()

Get the arguments for the command execution

Declaration
public virtual ArgumentCollection GetArguments()
Returns
Type Description
ArgumentCollection
| Edit this page View Source

SetValuesFromExecutionInfo()

Reads the arguments from the execution info and sets the values on to the argument definitions for the command.

Declaration
protected virtual void SetValuesFromExecutionInfo()
| Edit this page View Source

Validate()

Validate the arguments provided using the required argument definition for the command.

Declaration
protected virtual List<IArgument> Validate()
Returns
Type Description
List<IArgument>

List of invalid arguments

| Edit this page View Source

WriteLine()

Write a new line to the output provider

Declaration
protected virtual void WriteLine()
| Edit this page View Source

WriteLine(string)

Write a message to the output provider

Declaration
protected virtual void WriteLine(string text)
Parameters
Type Name Description
string text

Message to write

  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com