Ejemplo n.º 1
0
        /// <summary>
        /// Load NumberItem from XmlNode.
        /// </summary>
        /// <param name="propertyNode">XmlNode.</param>
        /// <param name="nsmgr">XmlNamespaceManager.</param>
        /// <returns>NumberItem.</returns>
        internal static NumberItem Load(XmlNode propertyNode, XmlNamespaceManager nsmgr)
        {
            Debug.Assert(propertyNode != null && nsmgr != null);

            NumberItem numberItem = null;
            if (propertyNode.SelectSingleNode("tts:number", nsmgr) != null)
            {
                numberItem = new NumberItem(propertyNode.SelectSingleNode("tts:number/@v", nsmgr).InnerText);
                XmlNode originalValueNode = propertyNode.SelectSingleNode("tts:number/@vo", nsmgr);
                if (originalValueNode != null && !string.IsNullOrEmpty(originalValueNode.InnerText))
                {
                    numberItem.OldValue = originalValueNode.InnerText;
                }
            }

            return numberItem;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LexiconItemProperty"/> class.
        /// Construction from Number item.
        /// </summary>
        /// <param name="number">Number value of this property.</param>
        public LexiconItemProperty(NumberItem number)
        {
            if (number == null)
            {
                throw new ArgumentNullException("number");
            }

            Number = number;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Clone function.
 /// </summary>
 /// <returns>NumberItem.</returns>
 public NumberItem Clone()
 {
     NumberItem clonedItem = new NumberItem();
     this.CopyTo(clonedItem);
     return clonedItem;
 }