-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWaitFormFunction.cs
More file actions
47 lines (45 loc) · 1.17 KB
/
WaitFormFunction.cs
File metadata and controls
47 lines (45 loc) · 1.17 KB
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace QSKSKS
{
public class WaitFormFunction
{
WaitingForm wait;
Thread loadThread;
public void Show()
{
loadThread = new Thread(new ThreadStart(LoadingProcess));
loadThread.Start();
}
public void Show(Form parent)
{
loadThread = new Thread(new ParameterizedThreadStart(LoadingProcess));
loadThread.Start(parent);
}
public void Close()
{
if (wait != null)
{
wait.BeginInvoke(new System.Threading.ThreadStart(wait.CloseWaitForm));
wait = null;
loadThread = null;
}
}
private void LoadingProcess()
{
wait = new WaitingForm();
wait.ShowDialog();
}
private void LoadingProcess(object parent)
{
Form openParent = parent as Form;
wait = new WaitingForm(openParent);
wait.ShowDialog();
}
}
}