コード例 #1
0
ファイル: Simulator.cs プロジェクト: henricj/phonesm
        public Simulator(IHttpClientFactoryParameters httpClientFactoryParameters)
        {
            if (httpClientFactoryParameters == null)
                throw new ArgumentNullException("httpClientFactoryParameters");

            _httpClientFactoryParameters = httpClientFactoryParameters;
        }
コード例 #2
0
ファイル: HttpClientFactory.cs プロジェクト: henricj/phonesm
        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;
        }
コード例 #3
0
 public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IHttpClientFactoryParameters httpClientFactoryParameters)
 {
     mediaStreamFacade.Builder.RegisterSingleton(httpClientFactoryParameters);
 }