/// <summary>
 /// Checks if a channel has an item like the item specified
 /// </summary>
 /// <param name="channel">the channel which items to check</param>
 /// <param name="item">the item to compare with</param>
 /// <returns>TRUE if the channel has an item alike the item specified</returns>
 private bool ChannelItemExistsByEtc(Channel channel, Channel.Item item)
 {
     //TODO change to ignore cases
     foreach (Channel.Item i in channel.Items)
     {
         if ((i.Title == item.Title)
             //&& (i.PubDate == item.PubDate)
             && (i.Link == item.Link) &&
             (i.Description == item.Description) &&
             (i.Comments == item.Comments) &&
             (i.Author == item.Author))
         {
             return(true);
         }
     }
     return(false);
 }
        private void ReadItem(XmlNode node, Channel channel)
        {
            Channel.Item item = new Channel.Item();
            if (node.HasChildNodes)
            {
                foreach (XmlNode child in node.ChildNodes)
                {
                    if (child.Name.Equals("title", StringComparison.CurrentCultureIgnoreCase))
                    {
                        item.Title = child.InnerText;
                    }
                    if (child.Name.Equals("link", StringComparison.CurrentCultureIgnoreCase))
                    {
                        item.Link = child.InnerText;
                    }
                    if (child.Name.Equals("description", StringComparison.CurrentCultureIgnoreCase))
                    {
                        item.Description = XmlStrings.FromXmlString(child.InnerText);
                    }
                    if (child.Name.Equals("author", StringComparison.CurrentCultureIgnoreCase))
                    {
                        item.Author = child.InnerText;
                    }
                    if (child.Name.Equals("category", StringComparison.CurrentCultureIgnoreCase))
                    {
                        item.Categories.Add(child.InnerText);
                    }
                    if (child.Name.Equals("comments", StringComparison.CurrentCultureIgnoreCase))
                    {
                        item.Comments = child.InnerText;
                    }
                    if (child.Name.Equals("enclosure", StringComparison.CurrentCultureIgnoreCase))
                    {
                        Channel.Item.RssEnclosure enclosure = new Channel.Item.RssEnclosure();
                        foreach (XmlAttribute attr in child.Attributes)
                        {
                            if (attr.Name.Equals("url", StringComparison.CurrentCultureIgnoreCase))
                            {
                                enclosure.Url = attr.Value;
                                if (auto_relocation_check)
                                {//TODO check if this gets into gc soon after using it
                                    UrlRelocationCheck urc = new UrlRelocationCheck(enclosure.Url);
                                    urc.FoundRelocatedUrl += delegate(UrlRelocationCheck found_urc)
                                    {
                                        enclosure.Url = found_urc.RelocatedUrl;

                                        //found_urc.Url = found_urc.RelocatedUrl;
                                        //found_urc.MimeType = "";
                                        //found_urc.RelocatedUrl = "";
                                        //found_urc.CheckUrl();
                                    };
                                    urc.CheckUrl();
                                }
                            }

                            try
                            {
                                if (attr.Name.Equals("length", StringComparison.CurrentCultureIgnoreCase))
                                {
                                    enclosure.Length = int.Parse(attr.Value);
                                }
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine("error parsing enclosure length: " + ex.Message);
                            }
                            if (attr.Name.Equals("type", StringComparison.CurrentCultureIgnoreCase))
                            {
                                enclosure.ContentType = attr.Value;
                            }
                        }
                        item.Enclosure = enclosure;
                    }
                    if (child.Name.Equals("source", StringComparison.CurrentCultureIgnoreCase))
                    {
                        Channel.Item.TitledUrl source = new Channel.Item.TitledUrl();
                        foreach (XmlAttribute attr in child.Attributes)
                        {
                            if (attr.Name.Equals("url", StringComparison.CurrentCultureIgnoreCase))
                            {
                                source.Url = attr.Value;
                            }
                        }
                        source.Title = child.InnerText;
                        item.Source  = source;
                    }
                    if (child.Name.Equals("guid", StringComparison.CurrentCultureIgnoreCase))
                    {
                        item.GUID = child.InnerText;
                    }
                    try
                    {
                        //if (child.Name.Equals("pubDate")) channel.PubDate = DateTime.ParseExact(child.InnerText, "ddd, dd MMM yyyy HH:mm:ss zzz", null);
                        //channel.PubDate = Convert.ToDateTime(child.InnerText);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("error parsing item pubDate(" + child.InnerText + "): " + ex.Message);
                    }
                }
            }
            channel.Items.Add(item);
        }