This repository has been archived by the owner on Jul 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
78 lines (64 loc) · 1.78 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using Mj.ViewModel;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interop;
namespace Mj
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
#region 窗口被动传参总开关IndexView().ShowDialog() == true
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
if (new View.IndexView().ShowDialog() == true)
{
;
}
else
{
//Application.Current.Shutdown();
}
}
#endregion
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
#region 单开"window", "ManySame") == "1"
System.Threading.Mutex mutex;
public App()
{
this.Startup += new StartupEventHandler(App_Startup);
}
void App_Startup(object sender, StartupEventArgs e)
{
bool ret;
mutex = new System.Threading.Mutex(true, "Mj", out ret);
if (!ret)
{
Mj.ViewModel.IndexViewModel IndexViewModel = new IndexViewModel();
if (IndexViewModel.ini.IniReadValue("window", "ManySame") == "1")
{
;
}
else
{
MessageBox.Show("嘤嘤嘤,太多了电脑会疼的");
Environment.Exit(0);
}
}
}
#endregion
}
}