Esempio n. 1
0
        /// <summary>
        /// Get all the rate limits of all the Twitter endpoints
        /// </summary>
        public static ICredentialsRateLimits GetCurrentCredentialsRateLimits(bool useRateLimitCache = false)
        {
            ICredentialsRateLimits credentialsRateLimits;

            if (!useRateLimitCache)
            {
                credentialsRateLimits = HelpController.GetCurrentCredentialsRateLimits();
                RateLimitCacheManager.UpdateCredentialsRateLimits(Auth.Credentials, credentialsRateLimits);
            }
            else
            {
                credentialsRateLimits = RateLimitCacheManager.GetCredentialsRateLimits(Auth.Credentials);
            }

            return(credentialsRateLimits);
        }
Esempio n. 2
0
        /// <summary>
        /// Get all the rate limits of all the Twitter endpoints
        /// </summary>
        public static ITokenRateLimits GetCurrentCredentialsRateLimits(bool useRateLimitCache = false)
        {
            ITokenRateLimits tokenRateLimits = null;

            if (!useRateLimitCache)
            {
                tokenRateLimits = HelpController.GetCurrentCredentialsRateLimits();
                _rateLimitCacheManager.UpdateTokenRateLimits(Auth.Credentials, tokenRateLimits);
            }
            else
            {
                tokenRateLimits = _rateLimitCacheManager.GetTokenRateLimits(Auth.Credentials);
            }

            return(tokenRateLimits);
        }