示例#1
0
文件: Trello.cs 项目: Bunk/trellow
	    public async Task<bool> AccessTokenIsFresh(OAuthToken accessToken)
	    {
	        try
	        {
                if (!_networkService.IsAvailable || accessToken == null)
                    return false;

	            var token = await Tokens.WithToken(accessToken.Key);
	            return token != null;
	        }
            catch (TrelloUnauthorizedException)
            {
                return false;
            }
            catch (TrelloException)
            {
                return false;
            }
            catch (Exception)
            {
                return false;
            }
	    }
示例#2
0
文件: Trello.cs 项目: Bunk/trellow
	    public void Authorize(OAuthToken accessToken)
	    {
	        _client.Authorize(accessToken);
	    }
示例#3
0
        private async void AccessGranted(OAuthToken token)
        {
            _settings.AccessToken = token;

            var profile = await _api.Members.Me();
            if (profile != null)
            {
                _settings.MemberId = profile.Id;
                _settings.Username = profile.Username;
                _settings.Fullname = profile.FullName;
                _settings.AvatarHash = profile.AvatarHash;
            }

            UsingView(view => view.Browser.Visibility = Visibility.Collapsed);
            _navigationService.UriFor<ShellViewModel>().Navigate();
        }