//////////////////// BACKGROUND WORKER //////////////////// private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { names = new string[sumListBox.Items.Count]; for (int i = 0; i < sumListBox.Items.Count; i++) { if (sumListBox.InvokeRequired) { this.Invoke(new MethodInvoker(delegate { names[i] = this.sumListBox.Items[i].Text; sumProgress.Maximum = names.Length * 100; })); } else { names[i] = this.sumListBox.Items[i].Text; sumProgress.Maximum = names.Length * 100; } } Analyzing.ReadLogs(names, sumGroupBox.Text, Settings.GetInstallDir(), 4, bgWorker); if (!Analyzing.hadError) { Analyzing.Count(sumGroupBox.Text, bgWorker); } else { LogBoxText = "The program encountered an error and can't finish the analyze!"; } }
private async void settingsSaveButton_Click(object sender, EventArgs e) // SAVE { installPath = Settings.Save(settingsRootBox.Text, settingsBotORBox.Checked); settingsRootBox.Text = Settings.GetInstallDir(); settingsSaveText.ForeColor = Color.Black; await Task.Delay(1000); settingsSaveText.ForeColor = settingsBox.BackColor; }
//////////////////// SETTINGS TAB //////////////////// private async void settingsReset_Click(object sender, EventArgs e) // RESET { Settings.Reset(); installPath = Settings.GetInstallDir(); settingsRootBox.Text = ""; settingsBotORBox.Checked = Settings.GetIncludeBots(); settingsHaveResetText.ForeColor = Color.Black; await Task.Delay(1000); settingsHaveResetText.ForeColor = settingsBox.BackColor; }
public Form1() { InitializeComponent(); _Form1 = this; settingsRootBox.Text = Settings.GetInstallDir(); settingsBotORBox.Checked = Boolean.Parse(Settings.GetSettings()[1]); if (Settings.GetInstallDir() == "" || Settings.GetInstallDir() == "\\") { MessageBox.Show("Please enter where your LoL is installed", "First time setup"); ChangeMenu(3); settingsRootButton_Click(this, EventArgs.Empty); settingsSaveButton_Click(this, EventArgs.Empty); } FixSize(); labelVersion.Text = "v" + Settings.version; }