-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathLSLolOffline.cs
101 lines (81 loc) · 2.44 KB
/
LSLolOffline.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
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 LeagueOFFLINE
{
public partial class LSLolOffline : Form
{
public LSLolOffline()
{
InitializeComponent();
}
private void switchButton_Click(object sender, EventArgs e)
{
try
{
Globals.fw.chat_dom = srvbox.Items[srvbox.SelectedIndex].ToString();
Globals.fw.chat_ip = Globals.lc.GetIPFromDomain();
var isBlocked = Globals.fw.isBlocked();
if (isBlocked)
{
Globals.fw.unblockLOL();
}
else
{
Globals.fw.blockLOL();
}
UpdateState(!isBlocked);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
private void LSLolOffline_Load(object sender, EventArgs e)
{
try
{
srvbox.SelectedIndex = 0;
Globals.lc.Init();
Globals.fw.chat_ip = Globals.lc.GetIPFromDomain();
Globals.fw.test();
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
private void pathText_TextChanged(object sender, EventArgs e)
{
}
private void UpdateState(bool isBlocked)
{
if (isBlocked)
{
switchButton.Text = "Switch to Online";
}
else
{
switchButton.Text = "Switch to Offline";
}
srvbox.ForeColor = isBlocked ? System.Drawing.Color.Red : System.Drawing.Color.Green;
}
private void srvbox_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Globals.fw.chat_dom = srvbox.Items[srvbox.SelectedIndex].ToString();
Globals.fw.chat_ip = Globals.lc.GetIPFromDomain();
var isBlocked = Globals.fw.isBlocked();
srvLabel.Focus();
UpdateState(isBlocked);
}
}
}