shanji 2 years ago
parent
commit
d372252580
  1. 2
      PJZS/App.xaml
  2. 8
      PJZS/App.xaml.cs
  3. 6
      PJZS/MainWindow.xaml.cs

2
PJZS/App.xaml

@ -4,7 +4,7 @@
xmlns:local="clr-namespace:PJZS"
xmlns:vm="clr-namespace:PJZS.ViewModels"
StartupUri="MainWindow.xaml"
ShutdownMode="OnExplicitShutdown">
ShutdownMode="OnMainWindowClose">
<Application.Resources>
<!--<ResourceDictionary>
<vm:ViewModelLocator x:Key="Locator"></vm:ViewModelLocator>

8
PJZS/App.xaml.cs

@ -11,6 +11,7 @@ using System.Windows;
using PJZS.Models;
using System.Linq;
using System.IO.MemoryMappedFiles;
using System.Diagnostics;
namespace PJZS
{
@ -24,6 +25,13 @@ namespace PJZS
protected override void OnStartup(StartupEventArgs e)
{
var pjzsExeList = Process.GetProcessesByName("PJZS");
if (pjzsExeList != null && pjzsExeList.Count() > 1)
{
Environment.Exit(Environment.ExitCode);
}
var gl = new GlobalContext();
string userToken = string.Empty;
#if DEBUG

6
PJZS/MainWindow.xaml.cs

@ -34,6 +34,12 @@ namespace PJZS
InitializeComponent();
this.managerDepartment = new List<string>() { "董事办", "财务部", "技术部", "总经办" };
this.Loaded += MainWindow_Loaded;
this.Closed += MainWindow_Closed;
}
private void MainWindow_Closed(object sender, EventArgs e)
{
Environment.Exit(Environment.ExitCode);
}
private bool CheckWebview2Runtime()

Loading…
Cancel
Save