Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
XmppMessage.cs
1using System;
2using System.Threading.Tasks;
3using System.Xml;
5
7{
12 {
16 public XmppMessage()
17 : base()
18 {
19 }
20
24 public override string LocalName => nameof(XmppMessage);
25
30 public override IStateMachineNode Create()
31 {
32 return new XmppMessage();
33 }
34
39 public override async Task Execute(EvaluationArguments Arguments)
40 {
41 string To = (await this.To.Evaluate(Arguments))?.ToString();
42 object Content = await this.Content.Evaluate(Arguments);
43 string ContentXml;
44
45 if (Content is XmlNode N)
46 ContentXml = N.OuterXml;
47 else
48 throw new Exception("Expected XML content.");
49
50 await Arguments.Legal.Server.SendMessage(string.Empty, string.Empty,
51 Arguments.EDaler.MainDomain, new XmppAddress(To), string.Empty, ContentXml);
52 }
53 }
54}
Contains information about one XMPP address.
Definition: XmppAddress.cs:9
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
Definition: XmppMessage.cs:39
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition: XmppMessage.cs:30
Contains information required for evaluating script in a state-machine.