示例#1
0
        /// <summary>
        /// Parses the expiration information from the element
        /// </summary>
        /// <param name="xe">the expiration element</param>
        private void processExpiration(XmlElement xe)
        {
            ObjectExpiration oe = new ObjectExpiration();

            foreach (XmlNode node in xe.ChildNodes)
            {
                if (!(node is XmlElement))
                {
                    continue;
                }
                XmlElement ele     = (XmlElement)node;
                string     tagName = ele.LocalName;
                if ("enabled".Equals(tagName))
                {
                    oe.Enabled = ele.InnerText.Equals("true");
                }
                else if ("endAt".Equals(tagName))
                {
                    if (ele.InnerText != null && ele.InnerText.Length > 0)
                    {
                        oe.EndAt = parseDate(ele.InnerText);
                    }
                }
                else
                {
                    throw new EsuException("Unknown Expiration tag: " + tagName);
                }
            }
            this.Expiration = oe;
        }
示例#2
0
 /// <summary>
 /// Parses the expiration information from the element
 /// </summary>
 /// <param name="xe">the expiration element</param>
 private void processExpiration(XmlElement xe)
 {
     ObjectExpiration oe = new ObjectExpiration();
     foreach (XmlNode node in xe.ChildNodes)
     {
         if (!(node is XmlElement))
         {
             continue;
         }
         XmlElement ele = (XmlElement)node;
         string tagName = ele.LocalName;
         if ("enabled".Equals(tagName))
         {
             oe.Enabled = ele.InnerText.Equals("true");
         }
         else if ("endAt".Equals(tagName))
         {
             if (ele.InnerText != null && ele.InnerText.Length > 0)
             {
                 oe.EndAt = parseDate(ele.InnerText);
             }
         }
         else
         {
             throw new EsuException("Unknown Expiration tag: " + tagName);
         }
     }
     this.Expiration = oe;
 }