Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ReportParameter.cs
1using System.Threading.Tasks;
2using System.Xml;
8using Waher.Script;
9
11{
15 public abstract class ReportParameter
16 {
17 private readonly ReportStringAttribute page;
18 private readonly ReportStringAttribute name;
19 private readonly ReportStringAttribute label;
20 private readonly ReportStringAttribute description;
21 private readonly ReportBooleanAttribute required;
22
27 public ReportParameter(XmlElement Xml)
28 {
29 this.page = new ReportStringAttribute(Xml, "page");
30 this.name = new ReportStringAttribute(Xml, "name");
31 this.label = new ReportStringAttribute(Xml, "label");
32 this.description = new ReportStringAttribute(Xml, "description");
33 this.required = new ReportBooleanAttribute(Xml, "required");
34 }
35
41 public Task<string> GetName(Variables Variables)
42 {
43 return this.name.Evaluate(Variables, string.Empty);
44 }
45
51 public Task<bool> IsRequired(Variables Variables)
52 {
53 return this.required.Evaluate(Variables, false);
54 }
55
61 public async Task<ReportParameterAttributes> GetReportParameterAttributes(Variables Variables)
62 {
63 return new ReportParameterAttributes()
64 {
65 Page = await this.page.Evaluate(Variables, string.Empty),
66 Name = await this.name.Evaluate(Variables, string.Empty),
67 Label = await this.label.Evaluate(Variables, string.Empty),
68 Description = await this.description.Evaluate(Variables, string.Empty),
69 Required = await this.required.Evaluate(Variables, false)
70 };
71 }
72
80
90 public abstract Task SetParameter(DataForm Parameters, Language Language, bool OnlySetChanged, Variables Variables,
92 }
93}
Static class managing editable parameters in objects. Editable parameters are defined by using the at...
Definition: Parameters.cs:26
Implements support for data forms. Data Forms are defined in the following XEPs:
Definition: DataForm.cs:42
Abstract base class for report parameters.
ReportParameter(XmlElement Xml)
Abstract base class for report parameters.
abstract Task SetParameter(DataForm Parameters, Language Language, bool OnlySetChanged, Variables Variables, SetEditableFormResult Result)
Sets the parameters of the object, based on contents in the data form.
abstract Task PopulateForm(DataForm Parameters, Language Language, Variables Variables)
Populates a data form with parameters for the object.
async Task< ReportParameterAttributes > GetReportParameterAttributes(Variables Variables)
Evaluates the attributes of the report parameter.
Task< string > GetName(Variables Variables)
Name of the parameter.
Task< bool > IsRequired(Variables Variables)
If parameter is required.
Contains information about a language.
Definition: Language.cs:17
Collection of variables.
Definition: Variables.cs:25