Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the FeedHttpInputChannel class with the specified destination and transport.
 /// </summary>
 /// <param name="destination">An Uri that represents the target destination for the channel.</param>
 /// <param name="transport">A FeedHttpTransport that represents the transport for the channel.</param>
 public FeedHttpInputChannel(Uri destination, FeedHttpTransport transport)
     : base(destination)
 {
     Transport = transport;
 }