Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
XmppIqSet.cs
1using System;
2using System.Threading.Tasks;
3using System.Xml;
5
7{
11 public class XmppIqSet : XmppRequest
12 {
16 public XmppIqSet()
17 : base()
18 {
19 }
20
24 public override string LocalName => nameof(XmppIqSet);
25
30 public override IStateMachineNode Create()
31 {
32 return new XmppIqSet();
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 IqResultEventArgs e = await Arguments.Legal.Server.IqRequest("set",
51 Arguments.EDaler.MainDomain, new XmppAddress(To), string.Empty, ContentXml);
52
53 if (!string.IsNullOrEmpty(this.ResponseVariable))
54 Arguments.Variables[this.ResponseVariable] = e;
55 }
56 }
57}
Event arguments for responses to IQ queries.
Contains information about one XMPP address.
Definition: XmppAddress.cs:9
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
Definition: XmppIqSet.cs:39
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition: XmppIqSet.cs:30
Contains information required for evaluating script in a state-machine.