public void EndGetAccessToken(RestRequest request, RestResponse response, object userState, AccessTokenCallbackDelegate callback)
        {
            if (string.IsNullOrEmpty(response.Content))
            {
                callback(request, response, null);
                return;
            }
            var r = new Regex("oauth_token=([^&.]*)&oauth_token_secret=([^&.]*)");
            Match match = r.Match(response.Content);
            var c = new Credentials
                        {
                            OAuthToken = match.Groups[1].Value,
                            OAuthTokenSecret = match.Groups[2].Value
                        };
            SetOAuthToken(c);

            if (callback != null)
                callback(request, response, c);
        }
        public void SetOAuthToken(Credentials credentials)
        {
            var consumerKey = ((OAuthCredentials)Credentials).ConsumerKey;
            var consumerSecret = ((OAuthCredentials)Credentials).ConsumerSecret;

            Credentials = new OAuthCredentials()
            {
                Token = credentials.OAuthToken,
                TokenSecret = credentials.OAuthTokenSecret,
                Type = OAuthType.ProtectedResource,
                ConsumerKey = consumerKey,
                ConsumerSecret = consumerSecret,
            };
            Client = new RestClient
                         {
#if SILVERLIGHT
                             HasElevatedPermissions = true,
#endif
                             Authority = Authority,
                             VersionPath = Version,
                         };
        }