Show / Hide Table of Contents

Class ApplicationMaintenanceCommand

Represents application maintenance command.

Inheritance
object
Symbol
Command
ApplicationMaintenanceCommand
Implements
IEnumerable
Inherited Members
Command.SetAction(Action<ParseResult>)
Command.SetAction(Func<ParseResult, int>)
Command.SetAction(Func<ParseResult, CancellationToken, Task>)
Command.SetAction(Func<ParseResult, CancellationToken, Task<int>>)
Command.Add(Argument)
Command.Add(Option)
Command.Add(Command)
Command.Parse(IReadOnlyList<string>, CommandLineConfiguration)
Command.Parse(string, CommandLineConfiguration)
Command.GetCompletions(CompletionContext)
Command.Children
Command.Arguments
Command.Options
Command.Subcommands
Command.Validators
Command.Aliases
Command.Action
Command.TreatUnmatchedTokensAsErrors
Symbol.ToString()
Symbol.Description
Symbol.Name
Symbol.Hidden
Symbol.Parents
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
Namespace: DotNext.Maintenance.CommandLine
Assembly: DotNext.MaintenanceServices.dll
Syntax
public sealed class ApplicationMaintenanceCommand : Command, IEnumerable
Remarks

All registered singleton services of this type in DI container will be automatically discovered by CommandLineMaintenanceInterfaceHost.

Constructors

| Edit this page View Source

ApplicationMaintenanceCommand(string, string?)

Initializes a new maintenance command.

Declaration
public ApplicationMaintenanceCommand(string name, string? description = null)
Parameters
Type Name Description
string name

The name of the command.

string description

The description of the command.

Methods

| Edit this page View Source

Create(IApplicationStatusProvider)

Creates a command that can be used to execute members of IApplicationStatusProvider.

Declaration
public static ApplicationMaintenanceCommand Create(IApplicationStatusProvider provider)
Parameters
Type Name Description
IApplicationStatusProvider provider

The status provider.

Returns
Type Description
ApplicationMaintenanceCommand

A new command.

Exceptions
Type Condition
ArgumentNullException

provider is null.

| Edit this page View Source

EnterInteractiveModeCommand()

Creates a command that allows to enter interactive mode.

Declaration
public static ApplicationMaintenanceCommand EnterInteractiveModeCommand()
Returns
Type Description
ApplicationMaintenanceCommand

A new command.

| Edit this page View Source

GCCommand()

Creates a command that allows to force Garbage Collection.

Declaration
public static ApplicationMaintenanceCommand GCCommand()
Returns
Type Description
ApplicationMaintenanceCommand

A new command.

| Edit this page View Source

GetDefaultCommands()

Gets a collection of default commands.

Declaration
public static IEnumerable<ApplicationMaintenanceCommand> GetDefaultCommands()
Returns
Type Description
IEnumerable<ApplicationMaintenanceCommand>

A collection of default commands.

See Also
GCCommand()
EnterInteractiveModeCommand()
LeaveInteractiveModeCommand()
| Edit this page View Source

HelpCommand()

Represents help command.

Declaration
public static ApplicationMaintenanceCommand HelpCommand()
Returns
Type Description
ApplicationMaintenanceCommand

A new command instance.

| Edit this page View Source

LeaveInteractiveModeCommand()

Creates a command that allows to leave interactive mode.

Declaration
public static ApplicationMaintenanceCommand LeaveInteractiveModeCommand()
Returns
Type Description
ApplicationMaintenanceCommand

A new command.

| Edit this page View Source

SetAction(Action<IMaintenanceSession, ParseResult>)

Sets synchronous command handler.

Declaration
public void SetAction(Action<IMaintenanceSession, ParseResult> handler)
Parameters
Type Name Description
Action<IMaintenanceSession, ParseResult> handler

The command handler.

Exceptions
Type Condition
ArgumentNullException

handler is null.

| Edit this page View Source

SetAction(Func<IMaintenanceSession, ParseResult, CancellationToken, ValueTask>)

Sets asynchronous command handler.

Declaration
public void SetAction(Func<IMaintenanceSession, ParseResult, CancellationToken, ValueTask> handler)
Parameters
Type Name Description
Func<IMaintenanceSession, ParseResult, CancellationToken, ValueTask> handler

The command handler.

Exceptions
Type Condition
ArgumentNullException

handler is null.

Events

| Edit this page View Source

Authorization

Allows to attach custom authorization rules for this command.

Declaration
public event AuthorizationCallback Authorization
Event Type
Type Description
AuthorizationCallback

Implements

IEnumerable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾