Show / Hide Table of Contents

Class AsynchronousCommand

Base class for commands that require access to async functionality for execution.

Inheritance
object
CommandBase
AsynchronousCommand
Implements
IAsyncCommand
Inherited Members
CommandBase._OutputProvider
CommandBase.ExecutionInfo
CommandBase.Arguments
CommandBase.GetArguments()
CommandBase.Description
CommandBase.WriteLine(string)
CommandBase.WriteLine()
CommandBase.DisplayUsage()
CommandBase.DisplayUsage(StringBuilder)
CommandBase.DisplayValidationSummary(List<IArgument>)
CommandBase.Validate()
CommandBase.SetValuesFromExecutionInfo()
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 AsynchronousCommand : CommandBase, IAsyncCommand

Constructors

| Edit this page View Source

AsynchronousCommand(CommandExecutionInfo, ITextOutputProvider)

Constructor

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

Command execution information

ITextOutputProvider outputProvider

Output provider instance

Methods

| Edit this page View Source

ExecuteAsync()

This is the async method that's called to run the command. It looks to see if the help argument string (--help) is on the command line and displays the usage if necessary. If the help string is not present, the arguments are validated. If validation succeeds, then OnExecute() is called

Declaration
public virtual Task ExecuteAsync()
Returns
Type Description
Task

Async task execution status

| Edit this page View Source

OnExecute()

Abstract method. This is where the work of the command should be added.

Declaration
protected abstract Task OnExecute()
Returns
Type Description
Task
| Edit this page View Source

OnValidationFailure(List<IArgument>)

Template method for handling validation failures. The default implementation displays the usage info for the command and the summary of validation errors.

Declaration
protected virtual void OnValidationFailure(List<IArgument> validationResult)
Parameters
Type Name Description
List<IArgument> validationResult

Implements

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