예제 #1
0
        private static void OnTokenChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            TwitterAuth twitterAuth = o as TwitterAuth;

            if (twitterAuth != null)
            {
                twitterAuth.OnTokenChanged((string)e.OldValue, (string)e.NewValue);
            }
        }
 private static TwitterService GetTwitterService(Tuple<string, string> authKeys)
 {
     TwitterService service = new TwitterService(authKeys.Item1, authKeys.Item2);
     OAuthRequestToken requestToken = service.GetRequestToken();
     Uri uri = service.GetAuthorizationUri(requestToken);
     var taw = new TwitterAuth() { AuthUrl = uri };
     taw.ShowDialog();
     OAuthAccessToken access = service.GetAccessToken(requestToken, taw.Token);
     service.AuthenticateWith(access.Token, access.TokenSecret);
     return service;
 }
예제 #3
0
        private static object OnCoerceToken(DependencyObject o, object value)
        {
            TwitterAuth twitterAuth = o as TwitterAuth;

            if (twitterAuth != null)
            {
                return(twitterAuth.OnCoerceToken((string)value));
            }
            else
            {
                return(value);
            }
        }
예제 #4
0
        private static object OnCoerceAuthUrl(DependencyObject o, object value)
        {
            TwitterAuth twitterAuth = o as TwitterAuth;

            if (twitterAuth != null)
            {
                return(twitterAuth.OnCoerceAuthUrl((Uri)value));
            }
            else
            {
                return(value);
            }
        }
예제 #5
0
        private static TwitterService GetTwitterService(Tuple <string, string> authKeys)
        {
            TwitterService    service      = new TwitterService(authKeys.Item1, authKeys.Item2);
            OAuthRequestToken requestToken = service.GetRequestToken();
            Uri uri = service.GetAuthorizationUri(requestToken);
            var taw = new TwitterAuth()
            {
                AuthUrl = uri
            };

            taw.ShowDialog();
            OAuthAccessToken access = service.GetAccessToken(requestToken, taw.Token);

            service.AuthenticateWith(access.Token, access.TokenSecret);
            return(service);
        }