Show / Hide Table of Contents

Class DefaultCommandShell

A default command shell.

Inheritance
System.Object
Loggable
DefaultCommandShell
Implements
ILoggable
ICommandShell
Inherited Members
Loggable.Logger
Loggable.GetLogger()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Application.Console
Assembly: Kephas.Application.Console.dll
Syntax
[OverridePriority(Priority.Lowest)]
public class DefaultCommandShell : Loggable, ILoggable, ICommandShell

Constructors

| Improve this Doc View Source

DefaultCommandShell(ICommandProcessor, ISerializationService, IContextFactory)

Initializes a new instance of the DefaultCommandShell class.

Declaration
public DefaultCommandShell(ICommandProcessor commandProcessor, ISerializationService serializationService, IContextFactory contextFactory)
Parameters
Type Name Description
ICommandProcessor commandProcessor

The command processor.

ISerializationService serializationService

The serialization service.

IContextFactory contextFactory

The context factory.

| Improve this Doc View Source

DefaultCommandShell(IConsole, ICommandProcessor, ISerializationService, IContextFactory)

Initializes a new instance of the DefaultCommandShell class.

Declaration
public DefaultCommandShell(IConsole console, ICommandProcessor commandProcessor, ISerializationService serializationService, IContextFactory contextFactory)
Parameters
Type Name Description
IConsole console

The console.

ICommandProcessor commandProcessor

The command processor.

ISerializationService serializationService

The serialization service.

IContextFactory contextFactory

The context factory.

Properties

| Improve this Doc View Source

Console

Gets the console.

Declaration
public IConsole Console { get; }
Property Value
Type Description
IConsole

The console.

Methods

| Improve this Doc View Source

ParseCommandLine(String)

Parses the command line.

Declaration
protected virtual (string command, IExpando args)ParseCommandLine(string commandLine)
Parameters
Type Name Description
System.String commandLine

The command line.

Returns
Type Description
System.ValueTuple<System.String, IExpando>

A Tuple consisting of the command and the command arguments.

| Improve this Doc View Source

ReadCommandLineAsync(CancellationToken)

Reads the command line asynchronously.

Declaration
protected virtual Task<string> ReadCommandLineAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

A token that allows processing to be cancelled.

Returns
Type Description
System.Threading.Tasks.Task<System.String>

An asynchronous result that yields the read command.

| Improve this Doc View Source

StartAsync(CancellationToken)

Starts processing commands asynchronously.

Declaration
public virtual Task StartAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

A token that allows processing to be cancelled.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

| Improve this Doc View Source

WriteCommandOutputAsync(Object, CancellationToken)

Writes a command output asynchronous.

Declaration
protected virtual Task WriteCommandOutputAsync(object result, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Object result

The result.

System.Threading.CancellationToken cancellationToken

A token that allows processing to be cancelled.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

| Improve this Doc View Source

WritePrompt()

Writes the prompt.

Declaration
protected virtual void WritePrompt()
| Improve this Doc View Source

WriteWelcomeScreen()

Writes the welcome screen.

Declaration
protected virtual void WriteWelcomeScreen()

Implements

ILoggable
ICommandShell

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX