Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CommandNoParameters.cs
1using System;
2using System.Threading.Tasks;
3
5{
9 public abstract class CommandNoParameters : IAdminCommand
10 {
15 {
16 }
17
21 public abstract string Name { get; }
22
26 public virtual string[] Aliases => null;
27
36 public virtual Task Execute(ChatState State, string[] Arguments, string OrgMessage, object Details,
37 ResponseCallbackHandler ResponseCallback)
38 {
39 return this.Execute(State, Arguments, OrgMessage, ResponseCallback);
40 }
41
49 public abstract Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback);
50
58 public virtual bool AppliesTo(string CommandLine, string[] Arguments, out object Details)
59 {
60 Details = null;
61 return Arguments.Length == 0;
62 }
63
68 public virtual HelpItem[] GetHelp()
69 {
70 return new HelpItem[] { new HelpItem(this.Name, this.HelpParagraphs) };
71 }
72
76 public abstract string[] HelpParagraphs
77 {
78 get;
79 }
80 }
81}
An administrative command with no parameters.
virtual HelpItem[] GetHelp()
Gets help about the command.
virtual string[] Aliases
Optional set of aliases. Can be null.
virtual bool AppliesTo(string CommandLine, string[] Arguments, out object Details)
If the command is applicable to the given command line.
abstract string[] HelpParagraphs
Markdown description of syntax.
virtual Task Execute(ChatState State, string[] Arguments, string OrgMessage, object Details, ResponseCallbackHandler ResponseCallback)
Executes the command.
abstract Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
Executes the command.
CommandNoParameters()
An administrative command with no parameters.
Contains an item of information about a command.
Definition: HelpItem.cs:9
Basic interface for administration commands
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.