Example #1
0
        internal static PageAdminSectionDefinition ReadPageAdminSectionXml(XmlElement cfxml)
        {
            PageAdminSectionDefinition def = new PageAdminSectionDefinition();

            def.SectionName = cfxml.GetAttribute("Name");

            XmlElement e = cfxml.SelectSingleNode("Label") as XmlElement;

            def.Label = e == null ? null : e.InnerText == "" ? null : e.InnerText;

            e        = cfxml.SelectSingleNode("Hint") as XmlElement;
            def.Hint = e == null ? null : e.InnerText == "" ? null : e.InnerText;

            if (cfxml.HasAttribute("InSection"))
            {
                string inSection = cfxml.GetAttribute("InSection");
                if (inSection != null && inSection != String.Empty)
                {
                    def.InSection = inSection;
                }
            }

            XmlNodeList efnodes = cfxml.SelectNodes("EditFields/*");

            foreach (XmlElement xml in efnodes)
            {
                IEditFieldObjectCreator creator = ContentManager.GetEditFieldObjectCreator(xml.Name);
                if (creator != null)
                {
                    IEditFieldHandler handler = creator.CreateHandler();
                    handler.Initialise(xml);
                    def.EditFieldHandlers.Add(handler);
                }
            }

            return(def);
        }
Example #2
0
        internal static PageAdminSectionDefinition ReadPageAdminSectionXml(XmlElement cfxml)
        {
            PageAdminSectionDefinition def = new PageAdminSectionDefinition();
            def.SectionName = cfxml.GetAttribute("Name");

            XmlElement e = cfxml.SelectSingleNode("Label") as XmlElement;
            def.Label = e == null ? null : e.InnerText == "" ? null : e.InnerText;

            e = cfxml.SelectSingleNode("Hint") as XmlElement;
            def.Hint = e == null ? null : e.InnerText == "" ? null : e.InnerText;

            if (cfxml.HasAttribute("InSection"))
            {
                string inSection = cfxml.GetAttribute("InSection");
                if (inSection != null && inSection != String.Empty)
                    def.InSection = inSection;
            }

            XmlNodeList efnodes = cfxml.SelectNodes("EditFields/*");
            foreach (XmlElement xml in efnodes)
            {
                IEditFieldObjectCreator creator = ContentManager.GetEditFieldObjectCreator(xml.Name);
                if (creator != null)
                {
                    IEditFieldHandler handler = creator.CreateHandler();
                    handler.Initialise(xml);
                    def.EditFieldHandlers.Add(handler);
                }
            }

            return def;
        }