Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ReportTimeSpanAttribute.cs
1using System;
2using System.Xml;
3
5{
9 public class ReportTimeSpanAttribute : ReportAttribute<TimeSpan>
10 {
16 public ReportTimeSpanAttribute(XmlElement Xml, string AttributeName)
17 : base(Xml, AttributeName)
18 {
19 }
20
26 public override TimeSpan ParseValue(string s)
27 {
28 if (TimeSpan.TryParse(s, out TimeSpan Value))
29 return Value;
30 else
31 throw new ArgumentException("Invalid TimeSpan value: " + s, nameof(s));
32 }
33 }
34}
Abstract base class for report attributes.
ReportTimeSpanAttribute(XmlElement Xml, string AttributeName)
Report TimeSpan attribute.
override TimeSpan ParseValue(string s)
Parses a string representation of a value.