-
Notifications
You must be signed in to change notification settings - Fork 29
/
ControlState.cs
75 lines (68 loc) · 2.66 KB
/
ControlState.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
namespace EntityListFinder
{
public class ControlState
{
private MainForm appForm;
public enum State
{
FORM_LOAD = 0,
PROCESS_ATTACHED,
SEARCH_BUTTON,
STOP_BUTTON,
VALIDATE_BUTTON
};
public ControlState(MainForm mainForm)
{
appForm = mainForm;
}
public void Change(State state)
{
switch (state)
{
case State.FORM_LOAD:
{
appForm.processNameLabel.Visible = false;
appForm.searchPanel.Visible = false;
appForm.marginOffsetTextBox.Enabled = false;
appForm.addressesToFindTextBox.Enabled = false;
appForm.loadAddressesButton.Enabled = false;
appForm.searchButton.Enabled = false;
break;
}
case State.PROCESS_ATTACHED:
{
appForm.processNameLabel.Visible = true;
appForm.marginOffsetTextBox.Enabled = true;
appForm.addressesToFindTextBox.Enabled = true;
appForm.loadAddressesButton.Enabled = true;
appForm.searchButton.Enabled = true;
break;
}
case State.SEARCH_BUTTON:
case State.VALIDATE_BUTTON:
{
appForm.searchPanel.Visible = true;
appForm.marginOffsetTextBox.Enabled = false;
appForm.addressesToFindTextBox.Enabled = false;
appForm.loadAddressesButton.Enabled = false;
appForm.searchButton.Enabled = false;
appForm.attachButton.Enabled = false;
appForm.saveButton.Enabled = false;
appForm.validateButton.Enabled = false;
break;
}
case State.STOP_BUTTON:
{
appForm.marginOffsetTextBox.Enabled = true;
appForm.addressesToFindTextBox.Enabled = true;
appForm.loadAddressesButton.Enabled = true;
appForm.searchButton.Enabled = true;
appForm.attachButton.Enabled = true;
appForm.saveButton.Enabled = true;
appForm.validateButton.Enabled = true;
break;
}
}
}
}
}