Ejemplo n.º 1
0
 public void _Add( Feed newFeed )
 {
     mFeeds.Add(newFeed);
 }
Ejemplo n.º 2
0
        public List<Channel> toList()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("test.xml");
            XmlElement root = doc.DocumentElement;
            List<Channel> Channels = new List<Channel>();

            foreach (XmlNode ChannelNode in root.ChildNodes)
            {
                Channel newChannel = new Channel("", "");
                newChannel.mTitle = ChannelNode.ChildNodes[0].InnerText;
                newChannel.mDescription = ChannelNode.ChildNodes[1].InnerText;
                newChannel.mDateAdded = ChannelNode.ChildNodes[2].InnerText;

                foreach (XmlNode FeedNode in ChannelNode.ChildNodes)
                {
                   if( FeedNode.Name == "Feed" )
                    {
                        Feed newFeed = new Feed("", "", "");
                        newFeed.mTitle = FeedNode.ChildNodes[0].InnerText;
                        newFeed.mURL = FeedNode.ChildNodes[1].InnerText;
                        newFeed.mDescription = FeedNode.ChildNodes[2].InnerText;
                        newChannel.mFeeds.Add(newFeed);
                    }

                }

                Channels.Add(newChannel);
            }

            return Channels;
        }