예제 #1
0
 //Methods
 /// <inheritdoc />
 protected override void Check()
 {
     if (NumOfReceptors < 1 || NumOfReceptors > 32)
     {
         throw new ArgumentException($"Invalid NumOfReceptors {NumOfReceptors.ToString(CultureInfo.InvariantCulture)}. NumOfReceptors must be GE to 1 and LE to 32.", "NumOfReceptors");
     }
     if (NumOfTimePoints < 1 || NumOfTimePoints > 32)
     {
         throw new ArgumentException($"Invalid NumOfTimePoints {NumOfTimePoints.ToString(CultureInfo.InvariantCulture)}. NumOfTimePoints must be GE to 1 and LE to 32.", "NumOfTimePoints");
     }
     return;
 }
예제 #2
0
        /// <inheritdoc />
        public override XElement GetXml(string rootElemName, bool suppressDefaults)
        {
            XElement rootElem = new XElement(rootElemName);

            if (!suppressDefaults || !IsDefaultNumOfReceptors)
            {
                rootElem.Add(new XAttribute("receptors", NumOfReceptors.ToString(CultureInfo.InvariantCulture)));
            }
            if (!suppressDefaults || !IsDefaultNumOfTimePoints)
            {
                rootElem.Add(new XAttribute("timePoints", NumOfTimePoints.ToString(CultureInfo.InvariantCulture)));
            }
            Validate(rootElem, XsdTypeName);
            return(rootElem);
        }