Esempio n. 1
0
        internal XmlNode ToXmlOne(XmlNode rootNode, RbacEntitlementScreen subScreen)
        {
            XmlNode nodeElement = rootNode.OwnerDocument.CreateElement("RbacEntitlementScreen");

            XmlAttribute name = rootNode.OwnerDocument.CreateAttribute("Name");

            name.Value = subScreen.Name;
            nodeElement.Attributes.Append(name);

            XmlAttribute text = rootNode.OwnerDocument.CreateAttribute("Text");

            text.Value = subScreen.Text;
            nodeElement.Attributes.Append(text);

            XmlAttribute visible = rootNode.OwnerDocument.CreateAttribute("Visible");

            visible.Value = subScreen.Visible ? "true" : "false";
            nodeElement.Attributes.Append(visible);

            XmlAttribute enabled = rootNode.OwnerDocument.CreateAttribute("Enabled");

            enabled.Value = subScreen.Enabled ? "true" : "false";
            nodeElement.Attributes.Append(enabled);


            foreach (RbacEntitlementScreen subsubsubScreen in subScreen.SubScreens)
            {
                nodeElement.AppendChild(ToXmlOne(nodeElement, subsubsubScreen));
            }
            return(nodeElement);
        }
Esempio n. 2
0
        private static RbacEntitlementScreen FromXmlOne(XmlNode node)
        {
            RbacEntitlementScreen nodeElement = new RbacEntitlementScreen();

            nodeElement.Name    = node.Attributes["Name"].Value;
            nodeElement.Text    = node.Attributes["Text"].Value;
            nodeElement.Enabled = node.Attributes["Enabled"].Value.ToLower() == "true" ? true : false;
            nodeElement.Visible = node.Attributes["Visible"].Value.ToLower() == "true" ? true : false;

            foreach (XmlNode childNode in node)
            {
                nodeElement.SubScreens.Add(FromXmlOne(childNode));
            }
            return(nodeElement);
        }
Esempio n. 3
0
        public static RbacEntitlementScreens FromXml(XmlNode entitlementMenuNode)
        {
            RbacEntitlementScreens screens = new RbacEntitlementScreens();

            foreach (XmlNode node in entitlementMenuNode.ChildNodes)
            {
                if (node.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }
                else if (node.Name == "RbacEntitlementScreen")
                {
                    screens.Screens.Add(RbacEntitlementScreen.FromXml(node));
                }
            }
            return(screens);
        }
Esempio n. 4
0
        public static RbacEntitlementScreen FromXml(XmlNode node)
        {
            RbacEntitlementScreen rootElement = new RbacEntitlementScreen();

            rootElement.Name    = node.Attributes["Name"].Value;
            rootElement.Text    = node.Attributes["Text"].Value;
            rootElement.Enabled = node.Attributes["Enabled"].Value.ToLower() == "true" ? true : false;
            rootElement.Visible = node.Attributes["Visible"].Value.ToLower() == "true" ? true : false;

            if (node.ChildNodes.Count == 0)
            {
                return(rootElement);
            }
            else
            {
                foreach (XmlNode childNode in node)
                {
                    rootElement.SubScreens.Add(FromXmlOne(childNode));
                }
            }
            return(rootElement);
        }