Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
XmppIqGet.cs
1using System;
2using System.Threading.Tasks;
3using System.Xml;
5
7{
11 public class XmppIqGet : XmppRequest
12 {
16 public XmppIqGet()
17 : base()
18 {
19 }
20
24 public override string LocalName => nameof(XmppIqGet);
25
30 public override IStateMachineNode Create()
31 {
32 return new XmppIqGet();
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("get",
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 IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition: XmppIqGet.cs:30
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
Definition: XmppIqGet.cs:39
Contains information required for evaluating script in a state-machine.