/// <summary> /// Generates xml element containing the settings. /// </summary> /// <param name="rootElemName">Name to be used as a name of the root element.</param> /// <param name="suppressDefaults">Specifies whether to ommit optional nodes having set default values</param> /// <returns>XElement containing the settings</returns> public override XElement GetXml(string rootElemName, bool suppressDefaults) { return(Validate(new XElement(rootElemName, new XAttribute("signal", Signal.ToString(CultureInfo.InvariantCulture)), new XAttribute("avgPeriod", AvgPeriod.ToString(CultureInfo.InvariantCulture)), new XAttribute("mode", Mode.ToString())), XsdTypeName)); }
//Methods /// <summary> /// Checks consistency /// </summary> protected override void Check() { if (AvgPeriod < 1) { throw new ArgumentException($"Invalid AvgPeriod {AvgPeriod.ToString(CultureInfo.InvariantCulture)}. AvgPeriod must be GE to 1.", "AvgPeriod"); } return; }