NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Monitor.Server.TextCommand.HelpCommand Class Reference
Inheritance diagram for Ntp.Analyzer.Monitor.Server.TextCommand.HelpCommand:
Collaboration diagram for Ntp.Analyzer.Monitor.Server.TextCommand.HelpCommand:

Public Member Functions

 HelpCommand (string[] args)
 
 HelpCommand (bool error)
 
- Public Member Functions inherited from Ntp.Analyzer.Monitor.Server.TextCommand.MonitorTextCommand
override object Execute ()
 

Protected Member Functions

override string ExecuteTextCommand ()
 
- Protected Member Functions inherited from Ntp.Analyzer.Monitor.Server.TextCommand.MonitorTextCommand
 MonitorTextCommand (string[] args)
 
 MonitorTextCommand ()
 

Private Attributes

readonly bool error
 

Additional Inherited Members

- Public Attributes inherited from Ntp.Analyzer.Monitor.Server.TextCommand.MonitorTextCommand
override CommandType CommandType => CommandType.Text
 
- Properties inherited from Ntp.Analyzer.Monitor.Server.TextCommand.MonitorTextCommand
string[] Args [get]
 
- Properties inherited from Ntp.Analyzer.Monitor.Server.Command
abstract CommandType CommandType [get]
 

Detailed Description

Definition at line 27 of file HelpCommand.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Monitor.Server.TextCommand.HelpCommand.HelpCommand ( string[]  args)
inline

Definition at line 29 of file HelpCommand.cs.

30  : base(args)
31  {
32  }
Ntp.Analyzer.Monitor.Server.TextCommand.HelpCommand.HelpCommand ( bool  error)
inline

Definition at line 34 of file HelpCommand.cs.

35  : base(new string[0])
36  {
37  this.error = error;
38  }

Member Function Documentation

override string Ntp.Analyzer.Monitor.Server.TextCommand.HelpCommand.ExecuteTextCommand ( )
inlineprotectedvirtual

Implements Ntp.Analyzer.Monitor.Server.TextCommand.MonitorTextCommand.

Definition at line 42 of file HelpCommand.cs.

References c, Ntp.Analyzer.Monitor.Server.CommandFactory.Commands, Ntp.Analyzer.Monitor.Server.ICommandDescription.Description, Ntp.Analyzer.Monitor.Server.ICommandDescription.Name, and version.

43  {
44  var builder = new StringBuilder();
45 
46  if (error)
47  {
48  builder.AppendLine("Unknown command.");
49  builder.AppendLine();
50  }
51 
52  var version = new VersionCommand(new string[0]);
53  builder.Append(version.Execute());
54  builder.AppendLine(". the following commands are valid.");
55 
56  int length = CommandFactory.Commands.Max(c => c.Description.Length);
57  length += 15 + 3;
58 
59  builder.AppendLine(string.Empty.PadLeft(length, '-'));
60 
61  foreach (ICommandDescription command in CommandFactory.Commands.OrderBy(c => c.Name))
62  {
63  builder.Append(command.Name.PadRight(15));
64  builder.AppendLine(command.Description);
65  }
66 
67  return builder.ToString();
68  }
var c
Definition: bootstrap.min.js:6
var version
Definition: bootstrap.js:13

Member Data Documentation

readonly bool Ntp.Analyzer.Monitor.Server.TextCommand.HelpCommand.error
private

Definition at line 40 of file HelpCommand.cs.


The documentation for this class was generated from the following file: