using System;
using System.Collections.Generic;
using System.Xml;
/// Thanks to XNA ScreenSaver Project scaffolding code writers for borrowed and modified code.
/// Modification and distribution rights assumed. Please contact if assumption in error.
namespace DarkWynter.Engine.Networking
{
///
/// Representation of a Channel element in an RSS 2.0 XML document.
/// One or more RssChannels are contained in an RssFeed.
///
public class RssChannel
{
private readonly string title;
private readonly string link;
private List items;
public string Title { get { return title; } }
public string Link { get { return link; } }
public IList Items { get { return items.AsReadOnly(); } }
///
/// Build an RSSChannel from an XmlNode representing a Channel element inside an RSS 2.0 XML document.
///
///
internal RssChannel(XmlNode channelNode)
{
items = new List();
title = channelNode.SelectSingleNode("title").InnerText;
link = channelNode.SelectSingleNode("link").InnerText;
XmlNodeList itemNodes = channelNode.SelectNodes("item");
foreach (XmlNode itemNode in itemNodes)
{
items.Add(new RssItem(itemNode));
}
}
}
}