bc... []

App.xaml.cs ( File view )

  • By 2016-05-19
  • View(s):0
  • Download(s):0
  • Point(s): 1
			using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace FloatPanelDemo {

	public partial class App : Application {


		public App() {

			this.Startup += this.Application_Startup;
			this.Exit += this.Application_Exit;
			this.UnhandledException += this.Application_UnhandledException;

			InitializeComponent();
		
}

		private void Application_Startup(object sender, StartupEventArgs e) {

			this.RootVisual = new MainPage();
		
}

		private void Application_Exit(object sender, EventArgs e) {


		
}

		private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) {

			// If the app is running outside of the debugger then report the exception using
			// the browser's exception mechanism. On IE this will display it a yellow alert 
			// icon in the status bar and Firefox will display a script error.
			if (!System.Diagnostics.Debugger.IsAttached) {


				// NOTE: This will allow the application to continue running after an exception has been thrown
				// but not handled. 
				// For production applications this error handling should be replaced with something that will 
				// report the error to the website and stop the application.
				e.Handled = true;
				Deployment.Current.Dispatcher.BeginInvoke(delegate {
 ReportErrorToDOM(e); 
});
			
}
		
}

		private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) {

			try {

				string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
				errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");

				System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
			
}
			catch (Exception) {

			
}
		
}
	
}

}
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.96 kB
democode.png15.50 kB2012-01-13 10:15
01.96 kB
FloatPanelDemo.sln2.38 kB2012-01-13 09:01
FloatPanelDemo.suo27.00 kB2012-01-13 10:29
01.96 kB
01.96 kB
FloatPanelDemo.xap5.55 kB2012-01-13 10:13
FloatPanelDemoTestPage.aspx2.87 kB2012-01-13 09:01
FloatPanelDemoTestPage.html2.81 kB2012-01-13 09:01
Silverlight.js7.50 kB2009-05-14 13:08
web.config312.00 B2012-01-13 09:01
App.xaml297.00 B2012-01-13 09:01
App.xaml.cs1.97 kB2012-01-13 09:01
01.96 kB
01.96 kB
AppManifest.xaml365.00 B2012-01-13 09:16
FloatPanelDemo.dll13.00 kB2012-01-13 10:13
FloatPanelDemo.pdb35.50 kB2012-01-13 10:13
FloatPanelDemo.xap5.55 kB2012-01-13 10:13
FloatPanelDemoTestPage.html2.78 kB2012-01-13 10:13
ContentDemo.xaml1.56 kB2012-01-13 10:11
ContentDemo.xaml.cs453.00 B2012-01-13 10:07
01.96 kB
FloatPanelDemo.csproj4.99 kB2012-01-13 10:10
FloatPanelDemo.csproj.user1.12 kB2012-01-13 10:10
FloatPanel.cs3.32 kB2012-01-13 10:29
MainPage.xaml477.00 B2012-01-13 09:01
MainPage.xaml.cs321.00 B2012-01-13 10:13
01.96 kB
01.96 kB
App.g.cs1.79 kB2012-01-13 09:01
App.g.i.cs1.79 kB2012-01-13 09:01
ContentDemo.g.cs1.98 kB2012-01-13 10:11
ContentDemo.g.i.cs1.98 kB2012-01-13 10:11
DesignTimeResolveAssemblyReferences.cache4.53 kB2012-01-13 10:11
DesignTimeResolveAssemblyReferencesInput.cache5.50 kB2012-01-13 10:13
FloatPanelDemo.csproj.FileListAbsolute.txt1.46 kB2012-01-13 10:10
FloatPanelDemo.dll13.00 kB2012-01-13 10:13
FloatPanelDemo.g.resources2.62 kB2012-01-13 10:11
FloatPanelDemo.pdb35.50 kB2012-01-13 10:13
MainPage.g.cs1.97 kB2012-01-13 09:01
MainPage.g.i.cs1.97 kB2012-01-13 09:01
SilverlightControl1.g.i.cs2.00 kB2012-01-13 10:06
01.96 kB
XapCacheFile.xml644.00 B2012-01-13 10:13
01.96 kB
AppManifest.xml207.00 B2012-01-13 09:01
AssemblyInfo.cs1.37 kB2012-01-13 09:01
overview.png28.22 kB2012-01-13 10:13
...

App.xaml.cs (104.68 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D