/// <summary> /// Get the transport associated with the specified destination. /// </summary> /// <param name="destination">Feed destination.</param> /// <returns>Transport object.</returns> public static IFeedTransport GetTransport(Uri destination) { IFeedTransport transport = null; if (destination == null) { throw new ArgumentNullException("destination"); } transport = FeedConfiguration.TransportConfiguration.GetTransport(destination.Scheme); if (transport == null) { switch (destination.Scheme) { case "http": transport = new FeedHttpTransport(); break; case "https": transport = new FeedHttpTransport(); break; } } return(transport); }
public Feed(string name, string url, IFeedTransport feedTransport, IFeedParser feedParser, IChannel channel, FeedTypes feedType) { Chanel = channel; ChanelId = channel.Id; Name = name; Url = url; FeedType = feedType; Init(); }
/// <summary> /// Gets the input channel for the transport. /// </summary> /// <param name="destination">The Uri to receive the RSS feeds.</param> /// <returns>The IFeedInputChannel associated with the transport. </returns> public static IFeedInputChannel StaticGetInputChannel(Uri destination) { IFeedTransport transport = FeedTransport.GetTransport(destination); if (transport != null) { return(transport.GetInputChannel(destination)); } return(null); }
/// <summary> /// Adds transport to the collection. /// </summary> /// <param name="scheme"></param> /// <param name="transport"></param> public void AddTransport(string scheme, IFeedTransport transport) { if ((scheme == null) || (scheme.Length == 0)) { throw new ArgumentNullException("scheme"); } if (transport == null) { throw new ArgumentNullException("transport"); } Transports[scheme] = transport; }
public void Init() { _saveCommand = DIService.Container.Resolve <IFeedSaveCommand>(); _deleteCommand = DIService.Container.Resolve <IFeedDeleteCommand>(); if (FeedType == FeedTypes.ATOM) { _feedParser = DIService.Container.Resolve <IFeedAtomParser>(); } else { _feedParser = DIService.Container.Resolve <IFeedRssParser>(); } _feedTransport = DIService.Container.Resolve <IFeedTransport>();; }
public FeedCreator(IFeedTransport feedTransport) { _feedTransport = feedTransport; }