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;
6
8{
13 {
17 public LegalId()
18 {
19 }
20
24 public override string Name => "LegalId";
25
33 public override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
34 {
35 StringBuilder Markdown = new StringBuilder();
36
37 Markdown.AppendLine("| ID | Expires |");
38 Markdown.AppendLine("|:---|:-------:|");
39
41 {
43
44 Markdown.Append("| `");
46 Markdown.Append("` | ");
47 if (TP < DateTime.Now)
48 Markdown.Append("**Expired**");
49 else
50 {
51 bool Soon = (TP - DateTime.Now).TotalDays < 60;
52
53 if (Soon)
54 Markdown.Append("**");
55
56 Markdown.Append(MarkdownDocument.Encode(TP.ToShortDateString()));
57
58 if (Soon)
59 Markdown.Append("**");
60 }
61
62 Markdown.AppendLine(" |");
63 }
64 else
65 Markdown.AppendLine("| N/A | N/A |");
66
67 await ResponseCallback(Markdown.ToString(), string.Empty);
68 }
69
73 public override string[] HelpParagraphs => new string[] { "Returns the ID of the last approved Legal ID." };
74 }
75}
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.