/// <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) { XElement rootElem = new XElement(rootElemName); if (!suppressDefaults || !IsDefaultSpectralRadius) { rootElem.Add(new XAttribute("spectralRadius", SpectralRadius == NASpectralRadiusNum ? NASpectralRadiusCode : SpectralRadius.ToString(CultureInfo.InvariantCulture))); } if (!suppressDefaults || !IsDefaultInputSynCfg) { rootElem.Add(InputSynCfg.GetXml(suppressDefaults)); } if (!suppressDefaults || !IsDefaultIndifferentSynCfg) { rootElem.Add(IndifferentSynCfg.GetXml(suppressDefaults)); } Validate(rootElem, XsdTypeName); return(rootElem); }
/// <inheritdoc /> public override XElement GetXml(string rootElemName, bool suppressDefaults) { XElement rootElem = new XElement(rootElemName); if (!suppressDefaults || !IsDefaultInputSynCfg) { rootElem.Add(InputSynCfg.GetXml(suppressDefaults)); } if (!suppressDefaults || !IsDefaultExcitatorySynCfg) { rootElem.Add(ExcitatorySynCfg.GetXml(suppressDefaults)); } if (!suppressDefaults || !IsDefaultInhibitorySynCfg) { rootElem.Add(InhibitorySynCfg.GetXml(suppressDefaults)); } Validate(rootElem, XsdTypeName); return(rootElem); }