Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LegalId.cs
1using System;
2using System.Text;
3using System.Threading.Tasks;
7
9{
14 {
18 public LegalId()
19 {
20 }
21
25 public override string Name => "LegalId";
26
34 public override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
35 {
36 StringBuilder Markdown = new StringBuilder();
37
38 Markdown.AppendLine("| ID | Expires |");
39 Markdown.AppendLine("|:---|:-------:|");
40
42 {
44
45 Markdown.Append("| `");
47 Markdown.Append("` | ");
48 if (TP < DateTime.Now)
49 Markdown.Append("**Expired**");
50 else
51 {
52 bool Soon = (TP - DateTime.Now).TotalDays < 60;
53
54 if (Soon)
55 Markdown.Append("**");
56
57 Markdown.Append(MarkdownDocument.Encode(TP.ToShortDateString()));
58
59 if (Soon)
60 Markdown.Append("**");
61 }
62 }
63 else
64 Markdown.AppendLine("| N/A | N/A |");
65
66 await ResponseCallback(Markdown.ToString(), string.Empty);
67 }
68
72 public override string[] HelpParagraphs => new string[] { "Returns the ID of the last approved Legal ID." };
73 }
74}
Contains a markdown document. This markdown document class supports original markdown,...
static string Encode(string s)
Encodes all special characters in a string so that it can be included in a markdown document without ...
An administrative command with no parameters.
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.