Esempio n. 1
0
        public void ParseGroup(System.Xml.XmlNode node)
        {
            var group = new XmlGroup()
            {
                Attributes = new System.Collections.Generic.Dictionary <String, String>()
            };

            if (node.Attributes != null && node.Attributes.Count > 0)
            {
                foreach (System.Xml.XmlAttribute attr in node.Attributes)
                {
                    if (!group.Attributes.ContainsKey(attr.Name))
                    {
                        group.Attributes.Add(attr.Name, attr.Value);
                    }
                }
            }

            foreach (System.Xml.XmlNode child in node)
            {
                switch (child.Name)
                {
                case "Name":
                    group.Name = child.InnerText;
                    break;

                case "Nodes":
                    group.Nodes = ParseNodes(child);
                    break;
                }
            }

            if (_store.Groups == null)
            {
                _store.Groups = new System.Collections.Generic.List <XmlGroup>()
                {
                    group
                }
            }
            ;
            else
            {
                _store.Groups.Add(group);
            }
        }
        public void ParseGroup(System.Xml.XmlNode node)
        {
            var group = new XmlGroup()
            {
                Attributes = new System.Collections.Generic.Dictionary<String, String>()
            };

            if (node.Attributes != null && node.Attributes.Count > 0)
            {
                foreach (System.Xml.XmlAttribute attr in node.Attributes)
                {
                    if (!group.Attributes.ContainsKey(attr.Name)) group.Attributes.Add(attr.Name, attr.Value);
                }
            }

            foreach (System.Xml.XmlNode child in node)
            {
                switch (child.Name)
                {
                    case "Name":
                        group.Name = child.InnerText;
                        break;
                    case "Nodes":
                        group.Nodes = ParseNodes(child);
                        break;
                }
            }

            if (_store.Groups == null) _store.Groups = new System.Collections.Generic.List<XmlGroup>() { group };
            else _store.Groups.Add(group);
        }