//Methods /// <inheritdoc /> protected override void Check() { if (InputFieldName.Length == 0) { throw new ArgumentException($"Name of the input field must be specified.", "InputFieldName"); } if (PastInterval < 1) { throw new ArgumentException($"Invalid past interval {PastInterval.ToString(CultureInfo.InvariantCulture)}. Interval must be GE to 1.", "PastInterval"); } return; }
/// <inheritdoc /> public override XElement GetXml(string rootElemName, bool suppressDefaults) { XElement rootElem = new XElement(rootElemName, new XAttribute("fieldName", InputFieldName) ); if (!suppressDefaults || !IsDefaultPastInterval) { rootElem.Add(new XAttribute("pastInterval", PastInterval.ToString(CultureInfo.InvariantCulture))); } Validate(rootElem, XsdTypeName); return(rootElem); }