-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateNewProcess.cs
More file actions
205 lines (151 loc) · 5.89 KB
/
CreateNewProcess.cs
File metadata and controls
205 lines (151 loc) · 5.89 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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ProcessSchedulerProyect
{
public partial class CreateNewProcess : Form
{
private Random rnd;
public CreateNewProcess()
{
InitializeComponent();
Button_Top_Brighty.Visible = false;
Button_Bottom_Bright.Visible = false;
Panel_Generate_Random_P.Visible = false;
Panel_Specific_Process.Visible = false;
//TIMEFRIEND.Text = GetRandomBoolean().ToString();
}
public bool GetRandomBoolean()
{
rnd = new Random();
return rnd.Next(0, 2) == 0;
}
public bool GetRandomBoolean2()
{
rnd = new Random();
return rnd.Next(0, 2) == 0;
}
public int GetRandomIntBro()
{
Random random = new Random();
int randomNumber = random.Next(0, 3);
return randomNumber;
}
private void Button_Top_Click(object sender, EventArgs e)
{
Panel_Generate_Random_P.Visible = true;
}
private void button1_Click(object sender, EventArgs e)
{
Panel_Generate_Random_P.Visible = true;
}
private void Button_Top_MouseEnter(object sender, EventArgs e)
{
Button_Top_Brighty.Visible = true;
}
private void Button_Top_MouseLeave(object sender, EventArgs e)
{
Button_Top_Brighty.Visible = false;
}
private void Button_Top_Brighty_MouseEnter(object sender, EventArgs e)
{
Button_Top_Brighty.Visible = true;
}
private void Button_Top_Brighty_MouseLeave(object sender, EventArgs e)
{
Button_Top_Brighty.Visible = false;
}
private void button1_Click_1(object sender, EventArgs e)
{
Panel_Generate_Random_P.Visible = true;
}
private void Button_Top_Continue_MouseEnter(object sender, EventArgs e)
{
Button_Top_Brighty.Visible = true;
}
private void Button_Bottom_Dark_MouseEnter(object sender, EventArgs e)
{
Button_Bottom_Bright.Visible = true;
}
private void Button_Bottom_Dark_MouseLeave(object sender, EventArgs e)
{
Button_Bottom_Bright.Visible = false;
}
private void Button_Bottom_Bright_MouseEnter(object sender, EventArgs e)
{
Button_Bottom_Bright.Visible = true;
}
private void Button_Bottom_Bright_MouseLeave(object sender, EventArgs e)
{
Button_Bottom_Bright.Visible = false;
}
private void button1_Click_2(object sender, EventArgs e)
{
Panel_Specific_Process.Visible = true;
}
private void Panel_Generate_Random_P_Paint(object sender, PaintEventArgs e)
{
}
private void Textbox_ProcessName_Enter(object sender, EventArgs e)
{
if (Textbox_ProcessName.Text == "PROCESS QUANTITY")
{
Textbox_ProcessName.Text = "";
Textbox_ProcessName.ForeColor = Color.Red;
}
}
private void Textbox_ProcessName_Leave(object sender, EventArgs e)
{
if (Textbox_ProcessName.Text == "PROCESS QUANTITY")
{
Textbox_ProcessName.Text = "";
Textbox_ProcessName.ForeColor = Color.Red;
}
}
private void SPG_TextBox_Name_Enter(object sender, EventArgs e)
{
if (SPG_TextBox_Name.Text == "NAME")
{
SPG_TextBox_Name.Text = "";
SPG_TextBox_Name.ForeColor = Color.Red;
}
}
private void SPG_TextBox_Name_Leave(object sender, EventArgs e)
{
if (SPG_TextBox_Name.Text == "")
{
SPG_TextBox_Name.Text = "NAME";
SPG_TextBox_Name.ForeColor = Color.Red;
}
}
private void Button_Generate_Click(object sender, EventArgs e)
{
string unused = "UNUSED";
Date daty = new Date(DateTime.Now.Day.ToString(), DateTime.Now.Month.ToString(), DateTime.Now.Year.ToString());
//ProcessClass processes = new ProcessClass(Textbox_ProcessName.Text, daty, used, SPG_ComboBox_Priority.Text, GetRandomBoolean(), GetRandomBoolean());
//Label_Test.Text = processes.ToString();
int total = int.Parse(Textbox_ProcessName.Text);
for (int i = 1; i <= total; i++)
{
ProcessClass processes = new ProcessClass(Data.getNextID(),"Process" + i, daty, unused, GetRandomIntBro().ToString(), GetRandomBoolean(), bool.Parse("false"));
Data.addProcess(processes);
}
Label_Process_Generated.Text = "Succesfully Generated";
}
private void SPG_Button_Generate_Click(object sender, EventArgs e)
{
string used2 = "UNUSED";
Date daty2 = new Date(DateTime.Now.Day.ToString(), DateTime.Now.Month.ToString(), DateTime.Now.Year.ToString());
ProcessClass processes = new ProcessClass(Data.getNextID(),SPG_TextBox_Name.Text, daty2, used2, SPG_ComboBox_Priority.Text, bool.Parse(SPG_ComboBox_NeedResources.Text), bool.Parse("false"));
Data.addProcess(processes);
SPG_Label_ProcessGenerated.Text = "Succesfully Generated";
}
//Button Top Changing From Dark to Bright
}
}