Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConcentratorClientExtension.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(ConcentratorClientExtension);
28
36 {
38 }
39
46 public override Task<object> Add(IActor Instance, Waher.Networking.XMPP.XmppClient Client)
47 {
48 ConcentratorClient Extension = new ConcentratorClient(Client);
49 Client.SetTag("ConcentratorClient", Extension);
50
51 Extension.OnEvent += (Sender, e) =>
52 {
53 this.Model.ExternalEvent(Instance, "OnEvent",
54 new KeyValuePair<string, object>("e", e),
55 new KeyValuePair<string, object>("Client", Client));
56
57 return Task.CompletedTask;
58 };
59
60 return Task.FromResult<object>(Extension);
61 }
62
63 }
64}
Root node of a simulation model
Definition: Model.cs:49
bool ExternalEvent(IExternalEventsNode Source, string Name, params KeyValuePair< string, object >[] Arguments)
Method called when an external event has been received.
Definition: Model.cs:889
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
ConcentratorClientExtension(ISimulationNode Parent, Model Model)
Concentrator Client XMPP extension
override string LocalName
Local name of XML element defining contents of class.
override Task< object > Add(IActor Instance, Waher.Networking.XMPP.XmppClient Client)
Adds the extension to the client.
Abstract base class for IoT XMPP extensions.
Implements an XMPP concentrator client interface.
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
Definition: XmppClient.cs:59
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
Definition: IActor.cs:11
Definition: App.xaml.cs:4