Beispiel #1
0
        private static T LoadFromRssXml <T>(string rssXml) where T : RssDocumentBase
        {
            if (string.IsNullOrEmpty(rssXml))
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "The argument '{0}' is Null or Empty", "xml"));
            }

            T rss = RssXmlHelper.DeserializeFromXmlUsingStringReader <T>(rssXml);

            return(rss);
        }
Beispiel #2
0
        private static T LoadFromRssXml <T>(string rssXml) where T : RssDocumentBase
        {
            if (string.IsNullOrEmpty(rssXml))
            {
                throw new ArgumentException("xml");
            }

            T rss = RssXmlHelper.DeserializeFromXmlUsingStringReader <T>(rssXml);

            return(rss);
        }
Beispiel #3
0
        private static T LoadFromRssXml <T>(string rssXml) where T : RssDocumentBase
        {
            if (string.IsNullOrEmpty(rssXml))
            {
                throw new ArgumentException(string.Format(Resources.RssToolkit.Culture, Resources.RssToolkit.ArgmentException, "xml"));
            }

            T rss = RssXmlHelper.DeserializeFromXmlUsingStringReader <T>(rssXml);

            return(rss);
        }
        public static T LoadRssFromOpmlUrl <T>(string url) where T : RssDocumentBase
        {
            if (string.IsNullOrEmpty(url))
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "The argument '{0}' is Null or Empty", "url"));
            }

            // resolve app-relative URLs
            url = RssXmlHelper.ResolveAppRelativeLinkToUrl(url);

            RssAggregator aggregator = new RssAggregator();

            aggregator.Load(new System.Uri(url));
            string rssXml = aggregator.RssXml;

            return(RssXmlHelper.DeserializeFromXmlUsingStringReader <T>(rssXml));
        }