|
using System.Reflection;
using System.Windows;
using System.Windows.Threading;
using AdventureWorks.Services;
using Xomega.Framework.Lookup;
using Xomega.Framework;
using System.ServiceModel;
using System;
using System.Xml;
using System.Xml.Linq;
using System.Windows.Data;
using System.Windows.Controls;
using System.Diagnostics;
namespace AdventureWorks.Client.WPF
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
Assembly asm = typeof(EmployeeKey).Assembly;
LookupCache.AddCacheLoader(new XmlLookupCacheLoader(asm.GetManifestResourceStream(
asm.GetName().Name + ".enumerations.xml")));
}
private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;
HandleException(e.Exception);
}
public static void HandleException(Exception ex)
{
ErrorList err = null;
FaultException<ErrorList> fex = ex as FaultException<ErrorList>;
if (fex != null) err = fex.Detail;
if (err == null)
{
err = new ErrorList();
err.Add(new ErrorMessage("EXCEPTION", ex.ToString()));
}
Errors.Show(err);
}
}
}
|
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.
Xomega Team is striving to increase productivity and development quality by utilizing Model Driven Development coupled with Code Generation and the best design practices for application development.
We provide MDD tools, code generators and frameworks for Visual Studio and .Net development.
Visit us at
http://www.xomega.net