main
 1using System;
 2using System.Security.Principal;
 3using System.Windows;
 4using System.Windows.Threading;
 5using gorilla.infrastructure.logging;
 6using solidware.financials.windows.ui.bootstrappers;
 7using solidware.financials.windows.ui.views;
 8
 9namespace solidware.financials.windows.ui
10{
11    static public class Program
12    {
13        [STAThread]
14        static public void Main(string[] args)
15        {
16            AppDomain.CurrentDomain.UnhandledException += (o, e) =>
17            {
18                (e.ExceptionObject as Exception).add_to_log();
19            };
20            AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
21            Dispatcher.CurrentDispatcher.UnhandledException += (o, e) =>
22            {
23                e.Exception.add_to_log();
24                new ErrorWindow {DataContext = e.Exception}.ShowDialog();
25                e.Handled = true;
26            };
27            new WPFApplication
28            {
29                ShutdownMode = ShutdownMode.OnMainWindowClose,
30            }.Run(Bootstrapper.create_window());
31        }
32    }
33}