//-----------------------------------------------------------------------
//
// Copyright (c) Takayoshi Matsuyama.
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or(at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with this program.
// If not, see.
//
//-----------------------------------------------------------------------
using System;
using System.Globalization;
using System.Windows;
using DataAggregator.Implementation.AppInfrastructure;
using DataAggregator.Implementation.UI.View;
namespace DataAggregator
{
///
/// Code-Behind of App.xaml.
///
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
try
{
Bootstrapper.InitializeApplication();
}
catch (Exception ex)
{
var notificationDialog = new NotificationDialog
{
NotificationMessage = string.Format(
CultureInfo.InvariantCulture,
"{0}: {1}\r\n{2}",
DataAggregator.Properties.Resources.SystemError,
ex.Message,
ex.StackTrace)
};
notificationDialog.ShowDialog();
Application.Current.Shutdown();
}
}
protected override void OnExit(ExitEventArgs e)
{
try
{
AppDisposer.DisposeApplication();
}
catch
{
// Do nothing. Ignore exception.
}
}
}
}