diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-08-31 22:20:01 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-08-31 22:20:01 -0700 |
commit | 0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f (patch) | |
tree | a6681a912fab62ccf5e8e005ac382f6bcfb34a4b /samples/OAuthConsumerWpf/Authorize.xaml.cs | |
parent | 0918f556a7da5f731b97cb4bbaa1ee5349c29d41 (diff) | |
parent | 307ba2d4b5ad4574a52922b40027ea978e3d8a04 (diff) | |
download | DotNetOpenAuth-0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f.zip DotNetOpenAuth-0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f.tar.gz DotNetOpenAuth-0488ebcfaef60e51bfcf7958b4a59d0ba5332a0f.tar.bz2 |
Merge branch 'v3.0' into v3.1
Conflicts:
src/DotNetOpenAuth.vsmdi
src/DotNetOpenAuth/OpenId/OpenIdStrings.Designer.cs
src/DotNetOpenAuth/OpenId/OpenIdStrings.resx
Diffstat (limited to 'samples/OAuthConsumerWpf/Authorize.xaml.cs')
-rw-r--r-- | samples/OAuthConsumerWpf/Authorize.xaml.cs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/samples/OAuthConsumerWpf/Authorize.xaml.cs b/samples/OAuthConsumerWpf/Authorize.xaml.cs index c28e6cc..2ee4d70 100644 --- a/samples/OAuthConsumerWpf/Authorize.xaml.cs +++ b/samples/OAuthConsumerWpf/Authorize.xaml.cs @@ -20,20 +20,17 @@ /// Interaction logic for Authorize.xaml /// </summary> public partial class Authorize : Window { - private DesktopConsumer google; + private DesktopConsumer consumer; private string requestToken; - internal Authorize(DesktopConsumer consumer) { + internal Authorize(DesktopConsumer consumer, FetchUri fetchUriCallback) { InitializeComponent(); - this.google = consumer; + this.consumer = consumer; Cursor original = this.Cursor; this.Cursor = Cursors.Wait; ThreadPool.QueueUserWorkItem(delegate(object state) { - Uri browserAuthorizationLocation = GoogleConsumer.RequestAuthorization( - this.google, - GoogleConsumer.Applications.Contacts | GoogleConsumer.Applications.Blogger, - out this.requestToken); + Uri browserAuthorizationLocation = fetchUriCallback(this.consumer, out this.requestToken); System.Diagnostics.Process.Start(browserAuthorizationLocation.AbsoluteUri); this.Dispatcher.BeginInvoke(new Action(() => { this.Cursor = original; @@ -42,10 +39,12 @@ }); } + internal delegate Uri FetchUri(DesktopConsumer consumer, out string requestToken); + internal string AccessToken { get; set; } private void finishButton_Click(object sender, RoutedEventArgs e) { - var grantedAccess = this.google.ProcessUserAuthorization(this.requestToken, verifierBox.Text); + var grantedAccess = this.consumer.ProcessUserAuthorization(this.requestToken, verifierBox.Text); this.AccessToken = grantedAccess.AccessToken; DialogResult = true; Close(); |