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 |
|
10 |
namespace NexusPowerControl |
11 |
{ |
12 |
public partial class DesktopSplash : Form |
13 |
{ |
14 |
MainUI ui = new MainUI(); |
15 |
|
16 |
const int MAX_TICK_COUNT = 10; // milliseconds |
17 |
int tick_count = 0; |
18 |
public DesktopSplash() |
19 |
{ |
20 |
InitializeComponent(); |
21 |
ui.FormClosed += new FormClosedEventHandler(ui_FormClosed); |
22 |
} |
23 |
|
24 |
void ui_FormClosed(object sender, FormClosedEventArgs e) |
25 |
{ |
26 |
this.Close(); |
27 |
} |
28 |
|
29 |
private void DesktopSplash_Shown(object sender, EventArgs e) |
30 |
{ |
31 |
timer1.Start(); |
32 |
} |
33 |
|
34 |
private void timer1_Tick(object sender, EventArgs e) |
35 |
{ |
36 |
tick_count++; |
37 |
if (tick_count > MAX_TICK_COUNT) |
38 |
{ |
39 |
timer1.Stop(); |
40 |
ui.ShowDialog(); |
41 |
} |
42 |
} |
43 |
} |
44 |
} |