Example #1
0
        public override XmlNode Clone()
        {
            AnyXmlElement targetEle = OwnerDocument.CreateElement(this.Name)
                                      as AnyXmlElement;

            XmlUtilService.CopyXmlElement(this, targetEle);
            return(targetEle);
        }
Example #2
0
        public override void Save()
        {
            SaveDoc();
            List <AnyXmlElement> channelEles = GetAllChannelElement();

            XmlUtilService.RemoveAllChilds(SdsiteElement);
            foreach (AnyXmlElement ele in channelEles)
            {
                AnyXmlElement cEle = (AnyXmlElement)CreateElement("channelofsnip");
                cEle.SetAttribute("id", ele.GetAttribute("id"));
                SdsiteElement.AppendChild(cEle);
            }
            base.Save();
        }
Example #3
0
        public override XmlElement CreateElement(string prefix, string localName, string namespaceURI)
        {
            switch (localName)
            {
            case "rect":    // modify by lukan, 2008年6月19日10时55分
            {
                SnipRectXmlElement ele = new SnipRectXmlElement(this);
                return(ele);
            }

            case "snip":
            {
                SnipXmlElement ele = new SnipXmlElement(this);
                return(ele);
            }

            case "parts":    // modify by lukan, 2008年6月19日10时55分
            {
                SnipPartsXmlElement ele = new SnipPartsXmlElement(this);
                return(ele);
            }

            case "part":
            {
                SnipPartXmlElement ele = new SnipPartXmlElement(this);
                return(ele);
            }

            case "rects":
            {
                SnipRectsXmlElement ele = new SnipRectsXmlElement(this);
                return(ele);
            }

            case "backImage":
            {
                AnyXmlElement ele = new AnyXmlElement("backImage", this);
                return(ele);
            }

            default:
                return(base.CreateElement(prefix, localName, namespaceURI));
            }
        }
Example #4
0
        //创建频道的相关节点
        public XmlElement CreateNode(string SearchContent)
        {
            string     nodeName    = string.Empty;
            XmlElement nodeElement = null;

            nodeName = CreatNodeName();
            AnyXmlElement singleElement = this.GetElementByName(nodeName);

            if (singleElement == null)
            {
                nodeElement = this.OwnerDocument.CreateElement(nodeName);
                this.AppendChild(nodeElement);
            }
            else
            {
                nodeElement = singleElement;
            }
            CreadChildNode(nodeElement, SearchContent);
            this.OwnerAnyDocument.Save();
            return(nodeElement);
        }
Example #5
0
        /// <summary>
        /// 获得所有频道节点集合
        /// </summary>
        /// <returns></returns>
        private List <AnyXmlElement> GetAllChannelElement()
        {
            List <AnyXmlElement> value             = new List <AnyXmlElement>();
            XmlNodeList          channelNodes      = SelectNodes("//channel");
            Dictionary <string, AnyXmlElement> dic = new Dictionary <string, AnyXmlElement>();

            foreach (XmlNode node in channelNodes)
            {
                AnyXmlElement ele = node as AnyXmlElement;
                if (!string.IsNullOrEmpty(ele.GetAttribute("id")))
                {
                    dic[ele.GetAttribute("id")] = ele;
                }
            }
            foreach (AnyXmlElement aEle in dic.Values)
            {
                value.Add(aEle);
            }

            return(value);
        }