2020-11-22 11:05:12 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
namespace Ink_Canvas
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for App.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class App : Application
|
|
|
|
|
{
|
2021-09-09 13:12:34 +08:00
|
|
|
|
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, "Ink_Canvas", out ret);
|
|
|
|
|
|
|
|
|
|
if (!ret)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("已有一个程序实例正在运行");
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2020-11-22 11:05:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|