Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
TableColumn.cs
1using SkiaSharp;
2using System.Threading.Tasks;
3using System.Xml;
6
8{
12 public class TableColumn
13 {
14 private readonly ReportStringAttribute columnId;
15 private readonly ReportStringAttribute header;
16 private readonly ReportStringAttribute dataSourceId;
17 private readonly ReportStringAttribute partition;
18 private readonly ReportColorAttribute fgColor;
19 private readonly ReportColorAttribute bgColor;
20 private readonly ReportEnumAttribute<ColumnAlignment> alignment;
21 private readonly ReportByteAttribute nrDecimals;
22
27 public TableColumn(XmlElement Xml)
28 {
29 this.columnId = new ReportStringAttribute(Xml, "columnId");
30 this.header = new ReportStringAttribute(Xml, "header");
31 this.dataSourceId = new ReportStringAttribute(Xml, "dataSourceId");
32 this.partition = new ReportStringAttribute(Xml, "partition");
33 this.fgColor = new ReportColorAttribute(Xml, "fgColor");
34 this.bgColor = new ReportColorAttribute(Xml, "bgColor");
35 this.alignment = new ReportEnumAttribute<ColumnAlignment>(Xml, "alignment");
36 this.nrDecimals = new ReportByteAttribute(Xml, "nrDecimals");
37 }
38
44 public async Task<Column> Evaluate(ReportState State)
45 {
46 string ColumnId = await this.columnId.Evaluate(State.Variables);
47 string Header = await this.header.Evaluate(State.Variables);
48 string DataSourceId = await this.dataSourceId.Evaluate(State.Variables);
49 string Partition = await this.partition.Evaluate(State.Variables);
50 SKColor? FgColor = this.fgColor.IsEmpty ? null : (SKColor?)await this.fgColor.Evaluate(State.Variables);
51 SKColor? BgColor = this.bgColor.IsEmpty ? null : (SKColor?)await this.bgColor.Evaluate(State.Variables);
52 ColumnAlignment? Alignment = this.alignment.IsEmpty ? null : (ColumnAlignment?)await this.alignment.Evaluate(State.Variables);
53 byte? NrDecimals = this.nrDecimals.IsEmpty ? null : (byte?)await this.nrDecimals.Evaluate(State.Variables);
54
55 return new Column(ColumnId, Header, DataSourceId, Partition, FgColor, BgColor, Alignment, NrDecimals);
56 }
57
58 }
59}
async Task< Column > Evaluate(ReportState State)
Evaluates the record definition.
Definition: TableColumn.cs:44
TableColumn(XmlElement Xml)
Defines a column in a table.
Definition: TableColumn.cs:27
Class containing the state of a report.
Definition: ReportState.cs:12
Variables Variables
Current set of variables.
Definition: ReportState.cs:55
Defines a column in a table.
Definition: Column.cs:30
ColumnAlignment
Column alignment.
Definition: Column.cs:9