Beispiel #1
0
        private void LoginCompleted(LoginInfo info)
        {
            Dispatcher.BeginInvoke(() =>
            {
                SetWorking(false);

                if (info == null)
                {
                    MessageBox.Show(DropBoxResources.LoginFailure,
                        DropBoxResources.LoginTitle,
                        MessageBoxButton.OK);

                    txtEmail.Focus();
                    txtEmail.SelectAll();

                    return;
                }

                txtPassword.Password = string.Empty;

                var folder = NavigationContext
                    .QueryString["folder"];

                this.NavigateTo<List>(
                    "token={0}&secret={1}&path=/&folder={2}",
                    info.Token, info.Secret, folder);
            });
        }
Beispiel #2
0
        private void InitAuthenticator(string token, string secret)
        {
            _loginInfo = new LoginInfo
            {
                Token = token,
                Secret = secret,
            };

            var credentials = OAuthCredentials.ForAccessToken(
                DropBoxInfo.KEY, DropBoxInfo.SECRET, token, secret);

            _client.Credentials = credentials;
            _fileClient.Credentials = credentials;
        }
Beispiel #3
0
 private void ClearAuthenticator()
 {
     _loginInfo = null;
     _client.Credentials = null;
     _fileClient.Credentials = null;
 }