-
Notifications
You must be signed in to change notification settings - Fork 535
/
GettingStarted.cs
70 lines (62 loc) · 2.26 KB
/
GettingStarted.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
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
namespace iSpyApplication
{
public partial class GettingStarted : Form
{
public bool LangChanged = false;
private WebBrowser _wbGettingStarted;
public GettingStarted()
{
InitializeComponent();
RenderResources();
}
private void RenderResources()
{
_btnOk.Text = LocRm.GetString("Ok");
chkShowGettingStarted.Text = LocRm.GetString("ShowGettingStarted");
Text = LocRm.GetString("GettingStarted");
}
private void GettingStarted_Load(object sender, EventArgs e)
{
int i = 0;
int selind = 0;
foreach (TranslationsTranslationSet set in LocRm.TranslationSets.OrderBy(p => p.Name))
{
_ddlLanguage.Items.Add(new MainForm.ListItem(set.Name, new[] { set.CultureCode }));
if (set.CultureCode == MainForm.Conf.Language)
selind = i;
i++;
}
_ddlLanguage.SelectedIndex = selind;
_wbGettingStarted = new WebBrowser();
pnlWBContainer.Controls.Add(_wbGettingStarted);
_wbGettingStarted.Location = new Point(0, 0);
_wbGettingStarted.Dock = DockStyle.Fill;
_wbGettingStarted.Navigate(MainForm.Website + "/getting_started.aspx");
chkShowGettingStarted.Checked = MainForm.Conf.Enabled_ShowGettingStarted;
}
private void _ddlLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
string lang = ((string[])((MainForm.ListItem)_ddlLanguage.SelectedItem).Value)[0];
if (lang != MainForm.Conf.Language)
{
MainForm.Conf.Language = lang;
LocRm.Reset();
RenderResources();
LangChanged = true;
}
}
private void _btnOk_Click(object sender, EventArgs e)
{
_wbGettingStarted.Dispose();
Close();
}
private void GettingStarted_FormClosing(object sender, FormClosingEventArgs e)
{
MainForm.Conf.Enabled_ShowGettingStarted = chkShowGettingStarted.Checked;
}
}
}