コード例 #1
0
        public async void Logout()
        {
            bool bRet = await oAuth.InvalidateToken();

            _recap = null;
            ReCapLoginIcon.Source = (Properties.Settings.Default.oauth_token_secret.Length == 0 ?
                                     new BitmapImage(new Uri(@"Images\Login.png", UriKind.Relative))
                                : new BitmapImage(new Uri(@"Images\Logout.png", UriKind.Relative))
                                     );
        }
コード例 #2
0
 protected bool ConnectWithReCap()
 {
     if (_recap != null)
     {
         return(true);
     }
     _recap = new AdskReCap(
         UserSettings.ReCapClientID,
         UserSettings.CONSUMER_KEY, UserSettings.CONSUMER_SECRET,
         Properties.Settings.Default.oauth_token, Properties.Settings.Default.oauth_token_secret
         );
     return(_recap != null);
 }
コード例 #3
0
        protected async Task <bool> ConnectWithReCapServer()
        {
            if (_recap != null)
            {
                return(true);
            }

            _recap = new AdskReCap(
                UserSettings.ReCapClientID,
                UserSettings.CONSUMER_KEY, UserSettings.CONSUMER_SECRET,
                Properties.Settings.Default.oauth_token, Properties.Settings.Default.oauth_token_secret
                );
            System.Diagnostics.Debug.WriteLine("tokens: " + Properties.Settings.Default.oauth_token + " - " + Properties.Settings.Default.oauth_token_secret, "Debug");
            if (!await TestConnection())
            {
                _recap = null;
            }
            return(_recap != null);
        }