| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using LocalhostMES.Controller;
- using LocalhostMES.Core;
- using LocalhostMES.ViewModels;
- using LocalhostMES.Views;
- using Microsoft.Owin.Hosting;
- using Prism.Ioc;
- using Prism.Regions;
- using Prism.Unity;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Configuration;
- using System.Data;
- using System.IO;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Windows;
- using Unity;
- namespace LocalhostMES
- {
- /// <summary>
- /// App.xaml 的交互逻辑
- /// </summary>
- public partial class App : PrismApplication
- {
- protected override Window CreateShell()
- {
-
- // 写入启动日志
- LogHelper.WriteLogInfo("程序启动");
- return Container.Resolve<MainView>();
- }
- protected override void RegisterTypes(IContainerRegistry containerRegistry)
- {
-
- containerRegistry.Register<MainViewModel>();
- }
- protected override void OnInitialized()
- {
- base.OnInitialized();
-
- }
- private static System.Threading.Mutex mutex;
- protected override void OnStartup(StartupEventArgs e)
- {
-
- mutex = new System.Threading.Mutex(true, "LocalhostMes_CRNS");
- if ( mutex.WaitOne(0, false) )
- {
- base.OnStartup(e);
- }
- else
- {
- MessageBox.Show("程序已经在运行!", "提示");
- this.Shutdown();
- }
- }
-
-
- }
- }
|