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 06:33:13 -0700
commit3c3bcd96b45099d45855a4cf29bcbb331f78f5ff (patch)
tree6e5b5e9f0a92ef7efffa1852285111183c61772b /samples/OpenIdOfflineProvider/MainWindow.xaml.cs
parent31a32680cb2b84d2e6765ad903e964ce6d673a67 (diff)
downloadDotNetOpenAuth-3c3bcd96b45099d45855a4cf29bcbb331f78f5ff.zip
DotNetOpenAuth-3c3bcd96b45099d45855a4cf29bcbb331f78f5ff.tar.gz
DotNetOpenAuth-3c3bcd96b45099d45855a4cf29bcbb331f78f5ff.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);
+ }
}
}
}