Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LegalId.cs
1
using
System;
2
using
System.Text;
3
using
System.Threading.Tasks;
4
using
Waher.Content.Markdown
;
5
using
Waher.IoTGateway
;
6
using
Waher.IoTGateway.Setup
;
7
8
namespace
Waher.Service.IoTBroker.Admin.Legal
9
{
13
public
class
LegalId
:
CommandNoParameters
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
41
if
(
LegalIdentityConfiguration
.
HasApprovedLegalIdentities
)
42
{
43
DateTime TP =
LegalIdentityConfiguration
.
LatestApprovedLegalIdentityExpires
;
44
45
Markdown.Append(
"| `"
);
46
Markdown.Append(
LegalIdentityConfiguration
.
LatestApprovedLegalIdentityId
);
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
}
Waher.Content.Markdown.MarkdownDocument
Contains a markdown document. This markdown document class supports original markdown,...
Definition:
MarkdownDocument.cs:50
Waher.Content.Markdown.MarkdownDocument.Encode
static string Encode(string s)
Encodes all special characters in a string so that it can be included in a markdown document without ...
Definition:
MarkdownDocument.cs:5771
Waher.IoTGateway.Setup.LegalIdentityConfiguration
Configures legal identity for the gateway.
Definition:
LegalIdentityConfiguration.cs:32
Waher.IoTGateway.Setup.LegalIdentityConfiguration.LatestApprovedLegalIdentityExpires
static DateTime LatestApprovedLegalIdentityExpires
Expiry date of latest approved legal identity.
Definition:
LegalIdentityConfiguration.cs:1301
Waher.IoTGateway.Setup.LegalIdentityConfiguration.HasApprovedLegalIdentities
static bool HasApprovedLegalIdentities
If there are approved legal identities configured.
Definition:
LegalIdentityConfiguration.cs:1260
Waher.IoTGateway.Setup.LegalIdentityConfiguration.LatestApprovedLegalIdentityId
static string LatestApprovedLegalIdentityId
Latest approved Legal Identity ID.
Definition:
LegalIdentityConfiguration.cs:1290
Waher.Service.IoTBroker.Admin.ChatState
State of a chat session
Definition:
ChatState.cs:12
Waher.Service.IoTBroker.Admin.CommandNoParameters
An administrative command with no parameters.
Definition:
CommandNoParameters.cs:10
Waher.Service.IoTBroker.Admin.Legal.LegalId
Performs a Ping-Ping request.
Definition:
LegalId.cs:14
Waher.Service.IoTBroker.Admin.Legal.LegalId.LegalId
LegalId()
Performs a Ping-Ping request.
Definition:
LegalId.cs:18
Waher.Service.IoTBroker.Admin.Legal.LegalId.Execute
override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
Executes the command.
Definition:
LegalId.cs:34
Waher.Service.IoTBroker.Admin.Legal.LegalId.HelpParagraphs
override string[] HelpParagraphs
Markdown description of syntax.
Definition:
LegalId.cs:72
Waher.Service.IoTBroker.Admin.Legal.LegalId.Name
override string Name
Command name
Definition:
LegalId.cs:25
Waher.Content.Markdown
Definition:
ConsolidatedTable.cs:11
Waher.IoTGateway.Setup
Definition:
AlternativeField.cs:4
Waher.IoTGateway
Definition:
App.xaml.cs:23
Waher.Service.IoTBroker.Admin.Legal
Definition:
LegalId.cs:9
Waher.Service.IoTBroker.Admin.ResponseCallbackHandler
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.
Waher.Service.IoTBroker
Admin
Legal
LegalId.cs
Generated by
1.9.5