forked from 84634E1A607A/ConwayLifeGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
49 lines (46 loc) · 1.36 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
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ConwayLifeGame
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static Control control;
public static Main main;
private static int mainLabelNo = 0;
public static void SetMainLabel(string a = null, int millseconds = 0, string b = null)
{
Task.Run(() =>
{
int n = ++mainLabelNo;
if (a != null) main.MainLabel.Text = a;
if (millseconds != 0)
{
Task.Delay(millseconds).Wait();
if (n == mainLabelNo) main.MainLabel.Text = b ?? "";
}
});
}
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
Application.Run(main = new Main());
}
catch (Exception e)
{
MessageBox.Show(e.Message + "\r\n" + e.StackTrace, e.GetType() + " unhandled");
throw;
}
}
}
}