FlatRedBall.Glue.Plugins.Rss.RssItem.ParseDescription C# (CSharp) Method

ParseDescription() private static method

private static ParseDescription ( System.Xml.Linq.XElement xElement, RssItem newItem, System.Xml.Linq.XElement subElement ) : System.Xml.Linq.XElement
xElement System.Xml.Linq.XElement
newItem RssItem
subElement System.Xml.Linq.XElement
return System.Xml.Linq.XElement
        private static XElement ParseDescription(XElement xElement, RssItem newItem, XElement subElement)
        {
            subElement = xElement.Element("description");
            if (subElement != null)
            {
                newItem.Description = subElement.Value;

                int indexOfComment = newItem.Description.IndexOf("<!--");

                if (indexOfComment != -1)
                {
                    string commentSection = newItem.Description.Substring(indexOfComment);

                    int indexOfLinkStart = commentSection.IndexOf("/><a href=\"http://www.gluevault.com/system/files/");
                    if (indexOfLinkStart != -1)
                    {
                        indexOfLinkStart = indexOfLinkStart + "/><a href=\"".Length;

                        string stringContainingFileAtStart = commentSection.Substring(indexOfLinkStart);

                        int endOfFile = stringContainingFileAtStart.IndexOf("\"");

                        string file = stringContainingFileAtStart.Substring(0, endOfFile);

                        newItem.DirectLink = file;
                    }
                }
            }
            return subElement;
        }