Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IqSetHandler.cs
1using System;
2using System.Collections.Generic;
3using System.Threading.Tasks;
6
8{
13 {
20 : base(Parent, Model)
21 {
22 }
23
27 public override string LocalName => nameof(IqSetHandler);
28
36 {
37 return new IqSetHandler(Parent, Model);
38 }
39
45 public override void RegisterHandlers(IActor Actor, XmppClient Client)
46 {
47 Client.RegisterIqSetHandler(this.Name, this.HandlerNamespace, (sender, e) =>
48 {
49 this.Trigger(Actor, new KeyValuePair<string, object>(string.IsNullOrEmpty(this.EventArgs) ? "e" : this.EventArgs, e));
50 return Task.CompletedTask;
51 }, true);
52 }
53 }
54}
Root node of a simulation model
Definition: Model.cs:49
Abstract base class for actors
Definition: Actor.cs:15
ISimulationNode Parent
Parent node in the simulation model.
Abstract base class for handler nodes
Definition: HandlerNode.cs:19
string EventArgs
Variable name for the event arguments
Definition: HandlerNode.cs:76
string HandlerNamespace
Namespace for the handler
Definition: HandlerNode.cs:51
virtual void Trigger(IActor Source, params KeyValuePair< string, object >[] Arguments)
Method called when an external event has been received.
Definition: HandlerNode.cs:136
string Name
Local element name for the handler
Definition: HandlerNode.cs:46
Custom IQ[type=set] handler.
Definition: IqSetHandler.cs:13
override string LocalName
Local name of XML element defining contents of class.
Definition: IqSetHandler.cs:27
override void RegisterHandlers(IActor Actor, XmppClient Client)
Registers handlers on the XMPP Client.
Definition: IqSetHandler.cs:45
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
Definition: IqSetHandler.cs:35
IqSetHandler(ISimulationNode Parent, Model Model)
Custom IQ[type=set] handler.
Definition: IqSetHandler.cs:19
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
Definition: XmppClient.cs:59
void RegisterIqSetHandler(string LocalName, string Namespace, EventHandlerAsync< IqEventArgs > Handler, bool PublishNamespaceAsClientFeature)
Registers an IQ-Set handler.
Definition: XmppClient.cs:2729
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
Definition: IActor.cs:11