summaryrefslogtreecommitdiffstats
path: root/debian/missing-sources/plupload/csharp/Plupload/App.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'debian/missing-sources/plupload/csharp/Plupload/App.xaml.cs')
-rw-r--r--debian/missing-sources/plupload/csharp/Plupload/App.xaml.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/missing-sources/plupload/csharp/Plupload/App.xaml.cs b/debian/missing-sources/plupload/csharp/Plupload/App.xaml.cs
new file mode 100644
index 0000000..9683c6d
--- /dev/null
+++ b/debian/missing-sources/plupload/csharp/Plupload/App.xaml.cs
@@ -0,0 +1,45 @@
+/**
+ * App.xaml.cs
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under GPL License.
+ *
+ * License: http://www.plupload.com/license
+ * Contributing: http://www.plupload.com/contributing
+ */
+
+using System.Windows;
+using System;
+using System.Windows.Browser;
+
+namespace Moxiecode.Plupload {
+ /// <summary>
+ /// Partial class for the Silverlight application.
+ /// </summary>
+ public partial class App : Application {
+ public App() {
+ this.Startup += this.OnStartup;
+ this.UnhandledException += this.Application_UnhandledException;
+
+ InitializeComponent();
+ }
+
+ private void OnStartup(object sender, StartupEventArgs e) {
+ this.RootVisual = new Page(e.InitParams);
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) {
+ if (!System.Diagnostics.Debugger.IsAttached) {
+ e.Handled = true;
+
+ try {
+ string errorMsg = e.ExceptionObject.Message + @"\n" + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace("\"", "\\\"").Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application: " + errorMsg + "\");");
+ } catch (Exception) {
+ }
+ }
+ }
+ }
+} \ No newline at end of file