summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdOfflineProvider/MainWindow.xaml.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-11-27 06:33:13 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-11-27 09:54:58 -0700
commit9a3d9e25223050e6c19ce507022e6c0af2afa1b4 (patch)
treea46829cad99fdebec506e82729c927ca7dce9eea /samples/OpenIdOfflineProvider/MainWindow.xaml.cs
parente9a2f0cad78c82a2db939fb8925f113d9215b239 (diff)
downloadDotNetOpenAuth-9a3d9e25223050e6c19ce507022e6c0af2afa1b4.zip
DotNetOpenAuth-9a3d9e25223050e6c19ce507022e6c0af2afa1b4.tar.gz
DotNetOpenAuth-9a3d9e25223050e6c19ce507022e6c0af2afa1b4.tar.bz2
Avoided offline OP app crash when copying to clipboard fails.
Diffstat (limited to 'samples/OpenIdOfflineProvider/MainWindow.xaml.cs')
-rw-r--r--samples/OpenIdOfflineProvider/MainWindow.xaml.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/samples/OpenIdOfflineProvider/MainWindow.xaml.cs b/samples/OpenIdOfflineProvider/MainWindow.xaml.cs
index f4f88ca..8f04da3 100644
--- a/samples/OpenIdOfflineProvider/MainWindow.xaml.cs
+++ b/samples/OpenIdOfflineProvider/MainWindow.xaml.cs
@@ -13,6 +13,7 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
using System.IO;
using System.Linq;
using System.Net;
+ using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -162,7 +163,11 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
private void opIdentifierLabel_MouseDown(object sender, MouseButtonEventArgs e) {
- Clipboard.SetText(opIdentifierLabel.Content.ToString());
+ try {
+ Clipboard.SetText(opIdentifierLabel.Content.ToString());
+ } catch (COMException ex) {
+ MessageBox.Show(this, ex.Message, "Error while copying OP Identifier to the clipboard", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
}
}
}