This repository was archived by the owner on Jun 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.cs
229 lines (201 loc) · 6.43 KB
/
Main.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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#region Imports
using System;
using System.Drawing;
using System.Windows.Forms;
using static Taskbar.Enum.Enums;
using static Witcher.Enum.Enums;
using static Witcher.WF.Struct.Structs;
using static Witcher.WF.Witcher;
using static Witcher.WF.Witcher.Property;
using static Witcher.Witcher.Property;
#endregion
namespace Witcher_WF_CR
{
public partial class Main : Form
{
private static Data Data = new()
{
Location = EdgeLocationType.TopRight,
Type = NotifyType.Standard,
Alert = AlertType.Success,
Theme = ThemeType.Dark,
Distance = 32,
Title = "Soferity Witcher WF",
Text = "My Name Is Soferity Witcher WF Sweetheart!",
Font = new Font("Raleway SemiBold", 12F, FontStyle.Bold, GraphicsUnit.Point, 162),
Size = new() { Width = 400, Height = 60 },
Pause = true,
Close = true,
Top = true,
Time = 5000
};
public Main()
{
InitializeComponent();
comboBox1.SelectedIndex = 5;
comboBox2.SelectedIndex = 0;
}
private void TextBox1_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
Data.Text = "My Name Is Soferity Witcher WF Sweetheart!";
}
else
{
Data.Text = textBox1.Text;
}
}
private void TextBox2_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox2.Text))
{
Data.Title = "Soferity Witcher WF";
}
else
{
Data.Title = textBox2.Text;
}
}
private void MaskedTextBox1_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(maskedTextBox1.Text) || string.IsNullOrWhiteSpace(maskedTextBox1.Text))
{
MaxOpen = 5;
}
else
{
MaxOpen = Convert.ToInt32(maskedTextBox1.Text);
}
}
private void MaskedTextBox2_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(maskedTextBox2.Text) || string.IsNullOrWhiteSpace(maskedTextBox2.Text))
{
Data.Time = 5000;
}
else
{
Data.Time = Convert.ToInt32(maskedTextBox2.Text);
}
}
private void MaskedTextBox3_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(maskedTextBox3.Text) || string.IsNullOrWhiteSpace(maskedTextBox3.Text))
{
Data.Distance = 32;
}
else
{
Data.Distance = Convert.ToInt32(maskedTextBox3.Text);
}
}
private void MaskedTextBox4_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(maskedTextBox4.Text) || string.IsNullOrWhiteSpace(maskedTextBox4.Text))
{
Data.Size.Height = 60;
}
else
{
Data.Size.Height = Convert.ToInt32(maskedTextBox4.Text);
}
}
private void MaskedTextBox5_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(maskedTextBox5.Text) || string.IsNullOrWhiteSpace(maskedTextBox5.Text))
{
Data.Size.Width = 400;
}
else
{
Data.Size.Width = Convert.ToInt32(maskedTextBox5.Text);
}
}
private void Thema_CheckedChanged(object sender, EventArgs e)
{
RadioButton RB = sender as RadioButton;
if (RB.Checked)
{
if (RB.Text == "Dark")
{
Data.Theme = ThemeType.Dark;
}
else if (RB.Text == "Light")
{
Data.Theme = ThemeType.Light;
}
else
{
Data.Theme = ThemeType.Custom;
}
}
}
private void ComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Data.Location = (EdgeLocationType)comboBox1.SelectedIndex;
}
private void ComboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
Data.Type = (NotifyType)comboBox2.SelectedIndex;
if (Data.Type == NotifyType.Standard)
{
maskedTextBox5.Text = "400";
maskedTextBox4.Text = "60";
}
else if (Data.Type == NotifyType.Beautiful)
{
maskedTextBox5.Text = "450";
maskedTextBox4.Text = "88";
}
}
private void Show_Click(object sender, EventArgs e)
{
Button B = sender as Button;
Data.Alert = B.Text switch
{
"Error" => AlertType.Error,
"Warning" => AlertType.Warning,
"Info" => AlertType.Info,
_ => AlertType.Success,
};
Notify.Show(Data);
}
private void Button7_Click(object sender, EventArgs e)
{
}
private void Button5_Click(object sender, EventArgs e)
{
Notify.ClearAll();
}
private void Status_Tick(object sender, EventArgs e)
{
toolStripStatusLabel1.Text = "Active: " + ActiveOpen;
toolStripStatusLabel2.Text = "Deactive: " + DeactiveOpen;
toolStripStatusLabel3.Text = "Total: " + TotalOpen;
}
private void Button6_Click(object sender, EventArgs e)
{
FontDialog FD = new();
FD.Font = Data.Font;
FD.MaxSize = 40;
FD.MinSize = 4;
if (FD.ShowDialog() == DialogResult.OK)
{
Data.Font = FD.Font;
}
}
private void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
Data.Pause = checkBox1.Checked;
}
private void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
Data.Top = checkBox2.Checked;
}
private void CheckBox3_CheckedChanged(object sender, EventArgs e)
{
Data.Close = checkBox3.Checked;
}
}
}