コード例 #1
0
        public static void ParseWebUser(IPermissionHandler handler, System.Xml.XmlNode node)
        {
            var player = new XmlPlayer()
            {
                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 (!player.Attributes.ContainsKey(attr.Name))
                    {
                        player.Attributes.Add(attr.Name, attr.Value);
                    }
                }
            }

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

                case "Nodes":
                    player.Nodes = handler.ParseNodes(child);
                    break;

                case "Groups":
                    player.Groups = handler.ParseArray(child);
                    break;
                }
            }

            if (_store == null)
            {
                _store = new System.Collections.Generic.List <XmlPlayer>()
                {
                    player
                }
            }
            ;
            else
            {
                _store.Add(player);
            }
        }
コード例 #2
0
        public static void ParseWebUser(IPermissionHandler handler, System.Xml.XmlNode node)
        {
            var player = new XmlPlayer()
            {
                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 (!player.Attributes.ContainsKey(attr.Name)) player.Attributes.Add(attr.Name, attr.Value);
                }
            }

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

            if (_store == null) _store = new System.Collections.Generic.List<XmlPlayer>() { player };
            else _store.Add(player);
        }