示例#1
0
        public Simulator(IHttpClientFactoryParameters httpClientFactoryParameters)
        {
            if (httpClientFactoryParameters == null)
                throw new ArgumentNullException("httpClientFactoryParameters");

            _httpClientFactoryParameters = httpClientFactoryParameters;
        }
示例#2
0
 public HttpClientFactory(IHttpClientFactoryParameters parameters, IWebReaderManagerParameters webReaderManagerParameters, IProductInfoHeaderValueFactory userAgentFactory, Func <HttpClientHandler> httpClientHandlerFactory)
 {
     if (null == parameters)
     {
         throw new ArgumentNullException("parameters");
     }
     if (null == webReaderManagerParameters)
     {
         throw new ArgumentNullException("webReaderManagerParameters");
     }
     if (null == userAgentFactory)
     {
         throw new ArgumentNullException("userAgentFactory");
     }
     if (null == httpClientHandlerFactory)
     {
         throw new ArgumentNullException("httpClientHandlerFactory");
     }
     this._referrer                   = parameters.Referrer;
     this._userAgent                  = userAgentFactory.Create();
     this._credentials                = parameters.Credentials;
     this._cookieContainer            = parameters.CookieContainer;
     this._webReaderManagerParameters = webReaderManagerParameters;
     this._httpClientHandlerFactory   = httpClientHandlerFactory;
 }
示例#3
0
        public HttpClientFactory(IHttpClientFactoryParameters parameters, IWebReaderManagerParameters webReaderManagerParameters, IProductInfoHeaderValueFactory userAgentFactory, Func<HttpClientHandler> httpClientHandlerFactory)
        {
            if (null == parameters)
                throw new ArgumentNullException(nameof(parameters));
            if (null == webReaderManagerParameters)
                throw new ArgumentNullException(nameof(webReaderManagerParameters));
            if (null == userAgentFactory)
                throw new ArgumentNullException(nameof(userAgentFactory));
            if (null == httpClientHandlerFactory)
                throw new ArgumentNullException(nameof(httpClientHandlerFactory));

            _referrer = parameters.Referrer;
            _userAgent = userAgentFactory.Create();
            _credentials = parameters.Credentials;
            _cookieContainer = parameters.CookieContainer;

            _webReaderManagerParameters = webReaderManagerParameters;
            _httpClientHandlerFactory = httpClientHandlerFactory;
        }
 public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IHttpClientFactoryParameters httpClientFactoryParameters)
 {
     mediaStreamFacade.Builder.RegisterSingleton(httpClientFactoryParameters);
 }