private static void OnReceiveComplete(IAsyncResult ar) { FeedAsyncResult result = ar as FeedAsyncResult; FeedInputChannel channel = result.Channel; Feed feed = channel.EndReceive(result); if (FeedEngine.FeedReceived != null) { FeedEngine.FeedReceived(feed); } if (receivers.Count > 0) { FeedReceiver receiver = receivers[channel.Destination] as FeedReceiver; if (receiver != null) { receiver.Receive(feed); } } // Update the storage if (Storage != null) { Storage.Add(feed); } }
/// <summary> /// Subscribes to the RSS feeds supplied in the OPML object. /// </summary> /// <param name="opml">The Opml object.</param> /// <returns>The Opml object.</returns> public static Opml SubscribeOpml(Opml opml) { if (opml == null) { throw new ArgumentNullException(); } foreach (OpmlItem item in opml.Items) { FeedEngine.Subscribe(new Uri(item.XmlUrl)); } return(opml); }
/// <summary> /// Subscribes to the RSS feeds supplied in the OPML file. /// </summary> /// <param name="opmlPath">The full path to the OPML file.</param> /// <returns>The Opml object.</returns> public static Opml SubscribeOpml(string opmlPath) { if (opmlPath == null) { throw new ArgumentNullException(); } if (opmlPath == string.Empty) { throw new ArgumentException(); } OpmlParser parser = new OpmlParser(); Opml opml = parser.Process(opmlPath); foreach (OpmlItem item in opml.Items) { FeedEngine.Subscribe(new Uri(item.XmlUrl)); } return(opml); }
public void Dispose() { FeedEngine.Stop(); GC.SuppressFinalize(this); }
private static void OnReceive(Uri destination) { FeedReceiver receiver = receivers[destination] as FeedReceiver; FeedEngine.Subscribe(destination, receiver); }