|
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;
using Wintellect.Sterling;
using System.IO.IsolatedStorage;
namespace SimpleAttendance
{
public partial class App : Application
{
public App()
{
this.Startup += this.Application_Startup;
UnhandledException += Application_UnhandledException;
try
{
// Test for Isolated Storage
using (IsolatedStorageFile oStore =
IsolatedStorageFile.GetUserStoreForApplication())
{
InitializeComponent();
}
}
catch (IsolatedStorageException)
{
MessageBox.Show("You neeed to right-click and enable Isolated Storage to use this application");
}
}
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new MainPage();
}
private static void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
Deployment.Current.Dispatcher.BeginInvoke(() => ReportErrorToDOM(e));
}
private static void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
{
var errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
MessageBox.Show(errorMsg);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.