//============================================================ // INSTANCE METHODS //============================================================ /// <summary> /// Provides example code for the Load(Uri, ICredentials, IWebProxy) method /// </summary> public static void LoadUriExample() { #region Load(Uri source, ICredentials credentials, IWebProxy proxy) GenericSyndicationFeed feed = new GenericSyndicationFeed(); Uri source = new Uri("http://feeds.feedburner.com/OppositionallyDefiant"); feed.Load(source, CredentialCache.DefaultNetworkCredentials, null); foreach (GenericSyndicationItem item in feed.Items) { if (item.PublishedOn > DateTime.Now.Subtract(new TimeSpan(7, 0, 0, 0))) { // Process generic item's published in the last week } foreach (GenericSyndicationCategory category in item.Categories) { if (String.Compare(category.Term, "WCF", StringComparison.OrdinalIgnoreCase) == 0) { // Process item category } } } #endregion }
public void TestCustomXmlNamespace() { // xmlns:content=""http://purl.org/rss/1.0/modules/content/"" var xml = @"<rss xmlns:app=""http:/example.com"" version=""2.0""></rss>"; var feed = new GenericSyndicationFeed(); feed.Load(xml); Assert.AreNotSame(new GenericSyndicationFeed(), feed); }