forked from sfmax54/Superior-Injector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.cs
63 lines (54 loc) · 1.87 KB
/
Settings.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
using System;
using MetroFramework.Forms;
using System.Windows.Forms;
using System.Diagnostics;
using System.Linq;
namespace Superior_Injector
{
public partial class Settings : MetroForm
{
public Settings()
{
InitializeComponent();
}
private void Settings_Load(object sender, EventArgs e)
{
DelayBar.Value = Config.InjectionDelay;
MethodBox.SelectedIndex = MethodBox.FindString(Config.InjectionMethod);
AsyncInjectionCheck.Checked = Config.AsyncInjection;
SecureModeCheck.Checked = Config.SecureMode;
}
private void LogoLabel_MouseDown(object sender, MouseEventArgs e)
{
Utils.ReleaseCapture();
Utils.SendMessage(Handle, Utils.WM_NCLBUTTONDOWN, Utils.HT_CAPTION, 0);
}
private void DelayBar_ValueChanged(object sender, EventArgs e)
{
DelayLabel.Text = DelayBar.Value.ToString();
Config.InjectionDelay = DelayBar.Value;
DelaySubLabel.Text = DelayBar.Value >= 10 ? " сек." : "сек.";
}
private void MethodBox_SelectedIndexChanged(object sender, EventArgs e)
{
Config.InjectionMethod = MethodBox.SelectedItem.ToString();
}
private void AsyncInjectionCheck_CheckedChanged(object sender, EventArgs e)
{
Config.AsyncInjection = AsyncInjectionCheck.Checked;
}
private void SaveSettings_Click(object sender, EventArgs e)
{
Config.SaveConfig();
this.Close();
}
private void Settings_FormClosing(object sender, FormClosingEventArgs e)
{
Config.SaveConfig();
}
private void SecureModeCheck_CheckedChanged(object sender, EventArgs e)
{
Config.SecureMode = SecureModeCheck.Checked;
}
}
}