1 |
using System; |
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel; |
4 |
using System.Data; |
5 |
using System.Drawing; |
6 |
using System.Linq; |
7 |
using System.Text; |
8 |
using System.Windows.Forms; |
9 |
using Ownskit.Utils; |
10 |
|
11 |
namespace NexusPowerControl |
12 |
{ |
13 |
public partial class DesktopSplash : Form |
14 |
{ |
15 |
KeyboardListener keyboard_listener = new KeyboardListener(); |
16 |
|
17 |
MainUI ui = new MainUI(); |
18 |
|
19 |
const int MAX_TICK_COUNT = 10; // milliseconds |
20 |
int tick_count = 0; |
21 |
public DesktopSplash() |
22 |
{ |
23 |
InitializeComponent(); |
24 |
keyboard_listener = new KeyboardListener(); |
25 |
keyboard_listener.DisableKeyboard(); |
26 |
|
27 |
ui.FormClosed += new FormClosedEventHandler(ui_FormClosed); |
28 |
} |
29 |
|
30 |
void ui_FormClosed(object sender, FormClosedEventArgs e) |
31 |
{ |
32 |
keyboard_listener.EnableKeyboard(); |
33 |
this.Close(); |
34 |
} |
35 |
|
36 |
private void DesktopSplash_Shown(object sender, EventArgs e) |
37 |
{ |
38 |
timer1.Start(); |
39 |
} |
40 |
|
41 |
private void timer1_Tick(object sender, EventArgs e) |
42 |
{ |
43 |
tick_count++; |
44 |
if (tick_count > MAX_TICK_COUNT) |
45 |
{ |
46 |
timer1.Stop(); |
47 |
ui.ShowDialog(); |
48 |
} |
49 |
} |
50 |
} |
51 |
} |