示例#1
0
 //Methods
 /// <summary>
 /// Checks consistency
 /// </summary>
 protected override void Check()
 {
     if (NumOfElements < 2)
     {
         throw new ArgumentException($"Invalid NumOfElements {NumOfElements.ToString(CultureInfo.InvariantCulture)}. NumOfElements must be GE to 2.", "NumOfElements");
     }
     return;
 }
示例#2
0
 /// <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("numOfElements", NumOfElements.ToString(CultureInfo.InvariantCulture))),
                     XsdTypeName));
 }