Exemplo n.º 1
0
        private IConsumerTokenManager GetTokenManager()
        {
            var store = System.Web.HttpContext.Current.Session;
                var tokenManager = (InMemoryTokenManager)store["TwitterShortTermUserSessionTokenManager"];
                if (tokenManager == null)
                {
                    string consumerKey = ConfigurationManager.AppSettings["twitterConsumerKey"];
                    string consumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"];

                    tokenManager = new InMemoryTokenManager(consumerKey, consumerSecret);
                    store["TwitterShortTermUserSessionTokenManager"] = tokenManager;
                }

                return tokenManager;
        }
Exemplo n.º 2
0
        private IConsumerTokenManager GetTokenManager()
        {
            var store        = System.Web.HttpContext.Current.Session;
            var tokenManager = (InMemoryTokenManager)store["TwitterShortTermUserSessionTokenManager"];

            if (tokenManager == null)
            {
                string consumerKey    = ConfigurationManager.AppSettings["twitterConsumerKey"];
                string consumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"];

                tokenManager = new InMemoryTokenManager(consumerKey, consumerSecret);
                store["TwitterShortTermUserSessionTokenManager"] = tokenManager;
            }


            return(tokenManager);
        }