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.Setup
;
6
7
namespace
Waher.Service.IoTBroker.Admin.Legal
8
{
12
public
class
LegalId
:
CommandNoParameters
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
40
if
(
LegalIdentityConfiguration
.
HasApprovedLegalIdentities
)
41
{
42
DateTime TP =
LegalIdentityConfiguration
.
LatestApprovedLegalIdentityExpires
;
43
44
Markdown.Append(
"| `"
);
45
Markdown.Append(
LegalIdentityConfiguration
.
LatestApprovedLegalIdentityId
);
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
}
Waher.Content.Markdown.MarkdownDocument
Contains a markdown document. This markdown document class supports original markdown,...
Definition:
MarkdownDocument.cs:52
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:5926
Waher.IoTGateway.Setup.LegalIdentityConfiguration
Configures legal identity for the gateway.
Definition:
LegalIdentityConfiguration.cs:33
Waher.IoTGateway.Setup.LegalIdentityConfiguration.LatestApprovedLegalIdentityExpires
static DateTime LatestApprovedLegalIdentityExpires
Expiry date of latest approved legal identity.
Definition:
LegalIdentityConfiguration.cs:1385
Waher.IoTGateway.Setup.LegalIdentityConfiguration.HasApprovedLegalIdentities
static bool HasApprovedLegalIdentities
If there are approved legal identities configured.
Definition:
LegalIdentityConfiguration.cs:1344
Waher.IoTGateway.Setup.LegalIdentityConfiguration.LatestApprovedLegalIdentityId
static string LatestApprovedLegalIdentityId
Latest approved Legal Identity ID.
Definition:
LegalIdentityConfiguration.cs:1374
Waher.Service.IoTBroker.Admin.ChatState
State of a chat session
Definition:
ChatState.cs:11
Waher.Service.IoTBroker.Admin.CommandNoParameters
An administrative command with no parameters.
Definition:
CommandNoParameters.cs:10
Waher.Service.IoTBroker.Admin.Legal.LegalId
Returns the latest approved Legal ID, if available.
Definition:
LegalId.cs:13
Waher.Service.IoTBroker.Admin.Legal.LegalId.LegalId
LegalId()
Returns the latest approved Legal ID, if available.
Definition:
LegalId.cs:17
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:33
Waher.Service.IoTBroker.Admin.Legal.LegalId.HelpParagraphs
override string[] HelpParagraphs
Markdown description of syntax.
Definition:
LegalId.cs:73
Waher.Service.IoTBroker.Admin.Legal.LegalId.Name
override string Name
Command name
Definition:
LegalId.cs:24
System
Definition:
Adapters.g.cs:58
Waher.Content.Markdown
Definition:
ConsolidatedTable.cs:11
Waher.IoTGateway.Setup
Definition:
App.xaml.cs:22
Waher.Service.IoTBroker.Admin.Legal
Definition:
LegalId.cs:8
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