Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
TableRecord.cs
2using System.Threading.Tasks;
3using System.Xml;
5using Waher.Script;
6
8{
12 public class TableRecord
13 {
14 private readonly ReportObjectAttribute[] elements;
15 private readonly int nrElements;
16
21 public TableRecord(XmlElement Xml)
22 {
23 List<ReportObjectAttribute> Elements = new List<ReportObjectAttribute>();
24
25 foreach (XmlNode N in Xml.ChildNodes)
26 {
27 if (N is XmlElement E && E.LocalName == "Element")
28 Elements.Add(new ReportObjectAttribute(E, null));
29 }
30
31 this.elements = Elements.ToArray();
32 this.nrElements = this.elements.Length;
33 }
34
38 public int NrElements => this.nrElements;
39
45 public async Task<object[]> Evaluate(ReportState State)
46 {
47 object[] Result = new object[this.nrElements];
48 int i;
49
50 for (i = 0; i < this.nrElements; i++)
51 Result[i] = await this.elements[i].Evaluate(State.Variables);
52
53 return Result;
54 }
55 }
56}
int NrElements
Number of elements in record.
Definition: TableRecord.cs:38
TableRecord(XmlElement Xml)
Defines a column in a table.
Definition: TableRecord.cs:21
async Task< object[]> Evaluate(ReportState State)
Evaluates the record definition.
Definition: TableRecord.cs:45
Class containing the state of a report.
Definition: ReportState.cs:12
Variables Variables
Current set of variables.
Definition: ReportState.cs:55