Пример #1
0
        public XmlElement Save(XmlDocument aDocument)
        {
            XmlElement bookmarkElement = aDocument.CreateElement("Bookmark");

            //@title
            XmlAttribute titleAttribute = aDocument.CreateAttribute("title");

            titleAttribute.Value = Title;
            bookmarkElement.Attributes.Append(titleAttribute);

            //@image
            XmlAttribute imageAttribute = aDocument.CreateAttribute("image");

            imageAttribute.Value = Image;
            bookmarkElement.Attributes.Append(imageAttribute);

            //@class
            XmlAttribute classAttribute = aDocument.CreateAttribute("class");

            classAttribute.Value = Class;
            bookmarkElement.Attributes.Append(classAttribute);

            if (BreadcrumbTrail == null)
            {
                BreadcrumbTrail = BreadcrumbTrail.Default;
            }

            bookmarkElement.AppendChild(BreadcrumbTrail.Save(aDocument));
            return(bookmarkElement);
        }
Пример #2
0
            public static string Convert(BreadcrumbTrail aBreadcrumbTrail)
            {
                XmlDocument doc = new XmlDocument();

                if (aBreadcrumbTrail != null)
                {
                    doc.AppendChild(aBreadcrumbTrail.Save(doc));
                }
                return(doc.OuterXml);
            }