コード例 #1
0
        /// <summary>
        /// Initializes static members of the <see cref="NetCache"/> class.
        /// </summary>
        static NetCache()
        {
            var innerHandler = Locator.Current.GetService <HttpMessageHandler>() ?? new HttpClientHandler();

            // NB: In vNext this value will be adjusted based on the user's
            // network connection, but that requires us to go fully platformy
            // like Splat.
            speculative   = new RateLimitedHttpMessageHandler(innerHandler, Priority.Speculative, 0, 1048576 * 5);
            userInitiated = new RateLimitedHttpMessageHandler(innerHandler, Priority.UserInitiated, 0);
            background    = new RateLimitedHttpMessageHandler(innerHandler, Priority.Background, 0);
            offline       = new OfflineHttpMessageHandler(null);
        }
コード例 #2
0
ファイル: Interfaces.cs プロジェクト: QuangDang212/Fusillade
        static NetCache()
        {
            var innerHandler = Locator.Current.GetService<HttpMessageHandler>() ?? new HttpClientHandler();

            // NB: In vNext this value will be adjusted based on the user's
            // network connection, but that requires us to go fully platformy
            // like Splat.
            speculative = new RateLimitedHttpMessageHandler(innerHandler, Priority.Speculative, 0, 1048576 * 5);
            userInitiated = new RateLimitedHttpMessageHandler(innerHandler, Priority.UserInitiated, 0);
            background = new RateLimitedHttpMessageHandler(innerHandler, Priority.Background, 0);
            offline = new OfflineHttpMessageHandler(null);
        }