-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
48 lines (46 loc) · 1.87 KB
/
Program.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
using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows.Forms;
namespace osu_private
{
internal static class Program
{
/// <summary>
/// アプリケーションのメイン エントリ ポイントです。
/// </summary>
[STAThread]
private static void Main()
{
if (Process.GetProcessesByName("osu!private").Length == 2)
{
MessageBox.Show("osu!privateは既に起動しています。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
CultureInfo.CurrentCulture = new CultureInfo("en-us");
CultureInfo.CurrentUICulture = new CultureInfo("en-us");
Application.EnableVisualStyles();
Application.ApplicationExit += (sender, args) =>
{
try
{
if (MainForm.Gosumemory != null && !MainForm.Gosumemory.HasExited) MainForm.Gosumemory.Kill();
}
catch (Exception error)
{
MessageBox.Show($"gosumemoryの終了に失敗しました。\nエラー内容: {error}", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
try
{
if (MainForm.OsuPrivate != null && !MainForm.OsuPrivate.HasExited) MainForm.OsuPrivate.Kill();
}
catch (Exception error)
{
MessageBox.Show($"osu!private.jsの終了に失敗しました。\nエラー内容: {error}", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
};
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new RegistrationForm());
}
}
}