2using System.Collections.Generic;
4using System.Threading.Tasks;
15 private string script;
58 public override Task
FromXml(XmlElement Definition)
60 this.script = Values.Script.RemoveIndent(Definition.InnerText);
63 return base.FromXml(Definition);
88 public override void ExportPlantUml(StreamWriter Output,
int Indentation,
char QuoteChar)
101 public static void ExportPlantUml(
string Script, StreamWriter Output,
int Indentation,
char QuoteChar,
bool Delimiters)
105 if (QuoteChar !=
'"')
108 foreach (
string Row
in Script.Replace(
"\r\n",
"\n").Replace(
"\r",
"\n").Split(
'\n'))
114 Indent(Output, Indentation);
123 if (!
string.IsNullOrEmpty(Row))
124 Output.Write(Row.Replace(
"\t",
"\\t"));
127 if (!First && Delimiters)
128 Output.WriteLine(
";");
Root node of a simulation model
Abstract base class for activity nodes
Executes script in an activity.
override string LocalName
Local name of XML element defining contents of class.
override bool ParseChildren
If children are to be parsed by FromXml(XmlElement)
override void ExportPlantUml(StreamWriter Output, int Indentation, char QuoteChar)
Exports PlantUML
override async Task< LinkedListNode< IActivityNode > > Execute(Variables Variables)
Executes a node.
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
string Script
Script string
static void ExportPlantUml(string Script, StreamWriter Output, int Indentation, char QuoteChar, bool Delimiters)
Exports PlantUML
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Eval(ISimulationNode Parent, Model Model)
Represents a delay in an activity.
Expression Expression
Parsed expression
static void Indent(StreamWriter Output, int Indentation)
Adds indentation to the current row.
Class managing a script expression.
async Task< object > EvaluateAsync(Variables Variables)
Evaluates the expression, using the variables provided in the Variables collection....
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.