Пример #1
0
        /// <summary>
        /// This method gets the nodes from the xml nodes which are the fields needed for the NaviationDisplayInfo
        /// </summary>
        /// <param name="xml">xml node passed</param>
        /// <returns>the parsed navigation display info</returns>
        private static NavigationDisplayInfo ParseTree(XmlNode xml)
        {
            XmlNode navDisplayParamNode = xml.SelectSingleNode("./DisplayParams");
            XmlNode navItemNode         = xml.SelectSingleNode("./NavItem");

            if (navDisplayParamNode == null)
            {
                log.Error("DisplayParams is null.");
                log.Error(xml.OuterXml);
                throw new Exception("Error: DisplayParams is null");
            }

            // Load details (if any) of the Navigation Item.
            NavigationItem item = null;

            if (navItemNode != null)
            {
                item = NavigationItem.ParseTree(navItemNode);
            }

            NavigationDisplayParams display = NavigationDisplayParams.ParseElement(navDisplayParamNode);

            NavigationDisplayInfo result = new NavigationDisplayInfo(item, display);


            return(result);
        }
        /// <summary>
        /// Gets the string for the css class node
        /// </summary>
        /// <param name="xml">the node passed from NavigationDisplayInfo</param>
        /// <returns>Navigation Display Params</returns>
        public static NavigationDisplayParams ParseElement(XmlNode xml)
        {
            XmlNode mobileNav = xml.SelectSingleNode("./MobileNav");

            if (mobileNav == null)
            {
                throw new Exception("Error: MobileNav is null");
            }

            NavigationDisplayParams result = new NavigationDisplayParams(mobileNav.InnerXml);


            return(result);
        }
Пример #3
0
 /// <summary>
 /// Internal Constructor for NavigationDisplayInfo
 /// Use ParseTree to get the item
 /// </summary>
 /// <param name="item">Navigation Item</param>
 /// <param name="display">NavigationDisplayParams</param>
 private NavigationDisplayInfo(NavigationItem item, NavigationDisplayParams display)
 {
     displayParams = display;
     rootNavItem   = item;
 }