using Prism.Ioc;
using Prism.Modularity;
using Prism.Unity;
using System;
using System.Threading;
using System.Windows;
using PunkHPX8_MainPages.Views;
using PunkHPX8_UI.Views;
using WPF.Themes.UserControls;
using Aitex.Core.Util;
using Aitex.Core.RT.Log;
using Aitex.Common.Util;
namespace PunkHPX8_UI
{
///
/// App.xaml 的交互逻辑
///
public partial class App : PrismApplication
{
System.Threading.Mutex mutex;
protected override void OnStartup(StartupEventArgs e)
{
bool ret;
mutex = new System.Threading.Mutex(true, "PunkHPX8_UI", out ret);
if (!ret)
{
WPFMessageBox.ShowError("Only One PunkHPX8_UI is allowed");
Environment.Exit(0);
}
LogDefineManager.Initialize(PathManager.GetCfgDir() + "LogDefine.json");
Singleton.Instance.Initialize();
base.OnStartup(e);
}
protected override Window CreateShell()
{
return Container.Resolve();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override IModuleCatalog CreateModuleCatalog()
{
return new ConfigurationModuleCatalog();
}
}
}