Пример #1
0
 public TwitterAuthCredentials(IPinObtainer pinObtainer, string consumerKey, string consumerSecret)
 {
     if (TryDeserialize(_serializationFilePath))
     {
         return;
     }
     ConsumerSecret = consumerSecret;
     ConsumerKey    = consumerKey;
     _pinObtainer   = pinObtainer;
     _service       = new TwitterService(consumerKey, consumerSecret);
 }
Пример #2
0
        public TwitterAuthCredentials(IPinObtainer pinObtainer, ITwitterAppCredentialsObtainer credentialsObtainer)
        {
            _pinObtainer         = pinObtainer;
            _credentialsObtainer = credentialsObtainer;

            if (TryDeserialize(_serializationFilePath))
            {
                return;
            }

            var appcreds = credentialsObtainer.GetAppCredentials();

            _service = new TwitterService(appcreds.ConsumerKey, appcreds.ConsumerKeySecret);

            TwitterAppCredentials appCredentials = _credentialsObtainer.GetAppCredentials();

            ConsumerKey    = appCredentials.ConsumerKey;
            ConsumerSecret = appCredentials.ConsumerKeySecret;
        }