Ejemplo 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);
        }
Ejemplo 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);
        }