Ejemplo n.º 1
0
        public WinRtHttpClientFactory(IWinRtHttpClientFactoryParameters parameters, IWebReaderManagerParameters webReaderManagerParameters, IHttpProductInfoHeaderValueFactory httpProductInfoFactory, Func<HttpBaseProtocolFilter> httpClientHandlerFactory)
        {
            if (null == parameters)
                throw new ArgumentNullException(nameof(parameters));
            if (null == webReaderManagerParameters)
                throw new ArgumentNullException(nameof(webReaderManagerParameters));
            if (null == httpProductInfoFactory)
                throw new ArgumentNullException(nameof(httpProductInfoFactory));
            if (null == httpClientHandlerFactory)
                throw new ArgumentNullException(nameof(httpClientHandlerFactory));

            _referrer = parameters.Referrer;
            _userAgent = httpProductInfoFactory.Create();
            _credentials = parameters.Credentials;

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