コード例 #1
0
        private async void LoadPin()
        {
            Dispatcher.InvokeAsync(() =>
            {
                TxtPin.Visibility = Visibility.Visible;
                PinError.Visibility = Visibility.Collapsed;
            });

            StopPinTimer();
            TxtPin.Text = string.Empty;

            try
            {
                _pinResult = await _connectionManager.CreatePin().ConfigureAwait(false);

                Dispatcher.InvokeAsync(() => TxtPin.Text = _pinResult.Pin);

                StartPinTimer();
            }
            catch (Exception)
            {
                OnPinError();
            }
        }
コード例 #2
0
        public async Task ExchangePin(PinCreationResult pin)
        {
            var result = await _connectService.ExchangePin(pin);

            var credentials = await _credentialProvider.GetServerCredentials().ConfigureAwait(false);

            credentials.ConnectAccessToken = result.AccessToken;
            credentials.ConnectUserId = result.UserId;

            await EnsureConnectUser(credentials, CancellationToken.None).ConfigureAwait(false);

            await _credentialProvider.SaveServerCredentials(credentials).ConfigureAwait(false);
        }
コード例 #3
0
 public Task<PinStatusResult> GetPinStatus(PinCreationResult pin)
 {
     return _connectService.GetPinStatus(pin);
 }