-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpla.cs
109 lines (100 loc) · 2.98 KB
/
Spla.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using System;
using System.Threading;
using System.Windows.Forms;
using Timer = System.Windows.Forms.Timer;
namespace EN2NGui
{
internal partial class Spla : Form
{
public Cursor tcursor;
private Timer UpdateCursor;
internal Spla()
{
InitializeComponent();
BackgroundImage = MiscData.spl;
Text = StringRes.GetString(StringRes.StringT.Hello);
LStats.Text = StringRes.GetString(StringRes.StringT.Init);
Ebutton.Text = ">>" + StringRes.GetString(StringRes.StringT.Exit);
Cbutton.Text = "*" + StringRes.GetString(StringRes.StringT.ContE);
tcursor = Cursor;
}
internal void UpdateLabel(string s)
{
if (LStats.InvokeRequired)
{
Action<string> actionDelegate = (x) => { LStats.Text = x; };
LStats.Invoke(actionDelegate, s);
}
else
{
LStats.Text = s;
}
}
internal void UpdateButton(bool b)
{
if (Ebutton.InvokeRequired)
{
Action<bool> actionDelegate = (x) => { Ebutton.Visible = x; Ebutton.Enabled = x; };
Ebutton.Invoke(actionDelegate, b);
}
else
{
Ebutton.Visible = b;
Ebutton.Enabled = b;
}
}
internal void UpdateCButton(bool b)
{
if (Cbutton.InvokeRequired)
{
Action<bool> actionDelegate = (x) => { Cbutton.Visible = x; Cbutton.Enabled = x; };
Cbutton.Invoke(actionDelegate, b);
}
else
{
Cbutton.Visible = b;
Cbutton.Enabled = b;
}
}
private void UpdateCursorF(object sender, EventArgs e)
{
if (Cursor != tcursor)
Cursor = tcursor;
}
private void Spla_Shown(object sender, EventArgs e)
{
Thread T = new Thread(InitTh.getInstance(this).Do);
T.Start();
UpdateCursor = new Timer();
UpdateCursor.Tick += new EventHandler(UpdateCursorF);
UpdateCursor.Interval = 1200;
UpdateCursor.Start();
}
private void Ebutton_Click(object sender, EventArgs e)
{
MiscData.isSplashExitAbornomal = true;
UpdateCursor.Stop();
Application.Exit();
}
private void Spla_FormClosing(object sender, FormClosingEventArgs e)
{
UpdateCursor.Stop();
}
private void Cbutton_Click(object sender, EventArgs e)
{
Close();
}
internal new void Close()
{
if (InvokeRequired)
{
Action act = new Action(base.Close);
Invoke(act);
}
else
{
base.Close();
}
}
}
}