示例#1
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Loads the RssMediaPrice object properties with the contents of the parent XElement
        /// </summary>
        /// <param name="parEl">Parent XElement</param>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public void Load(XElement parEl)
        {
            if (parEl.Name.Namespace == RSS.MEDIA_NS)
            {
                IEnumerable <XAttribute> lstAttr = parEl.Attributes();
                foreach (XAttribute attr in lstAttr)
                {
                    switch (attr.Name.LocalName)
                    {
                    case ATTR_TYPE:
                        type = xUtil.GetAttrStr(attr);
                        break;

                    case ATTR_INFO:
                        info = xUtil.GetAttrStr(attr);
                        break;

                    case ATTR_PRICE:
                        price = xUtil.GetAttrDec(attr);
                        break;

                    case ATTR_CURRENCY:
                        currency = xUtil.GetAttrStr(attr);
                        break;
                    }
                }
            }
        }