Exemple #1
0
        /// <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);
        }
Exemple #2
0
        /// <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);
        }
Exemple #3
0
        private static void OnReceive(Uri destination)
        {
            FeedReceiver receiver = receivers[destination] as FeedReceiver;

            FeedEngine.Subscribe(destination, receiver);
        }