2using System.Collections.Generic;
4using System.Threading.Tasks;
65 public override Task
FromXml(XmlElement Definition)
70 return base.FromXml(Definition);
79 if (this.value is
null)
82 throw new Exception(
"Value already registered.");
92 object Content = this.value is
null ? string.Empty : await this.value.
EvaluateAsync(
Variables) ??
string.Empty;
96 throw new Exception(
"Actor not an XMPP client.");
98 if (Content is XmlDocument Doc)
100 else if (Content is XmlElement E)
103 throw new Exception(
"Custom content in presence must be XML.");
117 public override void ExportPlantUml(StreamWriter Output,
int Indentation,
char QuoteChar)
119 base.ExportPlantUml(Output, Indentation, QuoteChar);
121 Indent(Output, Indentation);
123 Output.Write(this.actor.
Value);
124 Output.Write(
".SetPresence");
131 if (!(this.value is
null))
139 Output.WriteLine(
");");
Root node of a simulation model
Abstract base class for activity nodes
async Task< object > GetActorObjectAsync(StringAttribute Actor, Variables Variables)
Gets an actor object, given a string representation, possibly containing script, of the actor.
static void Indent(StreamWriter Output, int Indentation)
Adds indentation to the current row.
Contains the value of a string attribute, possibly with embedded script.
string Value
String value, from definition
Abstract base class for values
Sends a custom message to a recipient
static void AppendArgument(StreamWriter Output, int Indentation, string Name, string Value, bool Quotes, char QuoteChar)
Appends an argument
Sets the presence of the current actor.
override string LocalName
Local name of XML element defining contents of class.
void Register(IValue Value)
Registers a value for the argument.
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
override async Task< LinkedListNode< IActivityNode > > Execute(Variables Variables)
Executes a node.
override void ExportPlantUml(StreamWriter Output, int Indentation, char QuoteChar)
Exports PlantUML
SetPresence(ISimulationNode Parent, Model Model)
Sets the presence of the current actor.
override string Namespace
XML Namespace where the element is defined.
override string SchemaResource
Points to the embedded XML Schema resource defining the semantics of the XML namespace.
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Object used in simulation activities.
Abstract base class for XMPP actors.
XmppClient Client
XMPP Client
const string XmppSchema
TAG.Simulator.XMPP.Schema.ComSimXmpp.xsd
const string XmppNamespace
http://lab.tagroot.io/Schema/ComSim/XMPP.xsd
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
void SetTag(string TagName, object Tag)
Sets a tag value.
Task SetPresence()
Sets the presence of the connection. Add a CustomPresenceXml event handler to add custom presence XML...
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.
Task< object > EvaluateAsync(Variables Variables)
Evaluates the value.
Interface for nodes holding a value node
Availability
Resource availability.