Ejemplo n.º 1
0
        public void AddSubTopicToDetached(Topic SubTopic)
        {
            if (_children == null)
            {
                _children = new Children();
                _children.AddTopics(new Topics("detached"));
            }

            Topics detached = _children.TopicsList.Find(item => item.Type == "detached");

            if (detached != null)
            {
                detached.AddTopic(SubTopic);
            }
            else
            {
                _children.AddTopics(new Topics("detached"));
                detached = _children.TopicsList.Find(item => item.Type == "detached");
                detached.AddTopic(SubTopic);
            }
        }
Ejemplo n.º 2
0
        public static Topics ParseXmlNode(XElement Node)
        {
            Topics t = new Topics();

            IEnumerable <XAttribute> attrCol = Node.Attributes();

            foreach (XAttribute item in attrCol)
            {
                switch (item.Name.LocalName)
                {
                case Constants.TYPE:
                    t.Type = item.Value;
                    break;

                default:
                    break;
                }
            }


            IEnumerable <XElement> nodeliste = Node.Elements();

            foreach (XElement item in nodeliste)
            {
                switch (item.Name.LocalName)
                {
                case Constants.TOPIC:
                    t.AddTopic(Topic.ParseXmlNode(item));
                    break;

                default:
                    break;
                }
            }
            return(t);
        }