private void toolStripMenuItem1_Click(object sender, EventArgs e) { einstellungen.AutostartGruppe = listToolgruppen.SelectedItem.ToString(); einstellungen.save(); einstellungen = einstellungen.load(); }
private void bSpeichern_Click(object sender, EventArgs e) { Einstellungen ein = new Einstellungen(); ein.path = textBox1.Text; ein.alt = checkAlt.Checked; ein.shift = checkShift.Checked; ein.steuerung = checkSteuerung.Checked; ein.key = (Keys)Enum.Parse(typeof(Keys), bKey.Text); ein.autostart = checkAuto.Checked; RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (ein.autostart) { Verknüpfung.VerknüpfungErstellen(Application.ExecutablePath, Application.StartupPath, Application.StartupPath + "\\logo.ico", "startup"); System.IO.File.SetAttributes(Application.StartupPath + "\\OpenTools V2.0.lnk", System.IO.FileAttributes.Hidden); rkApp.SetValue(Application.ProductName, Application.StartupPath + "\\OpenTools V2.0.lnk"); } else { rkApp.DeleteValue(Application.ProductName, false); System.IO.File.Delete(Application.StartupPath + "\\OpenTools V2.0.lnk"); } ein.save(); Close(); }
private void bFertig_Click(object sender, EventArgs e) { System.IO.File.Delete(einstellungen.path + "OpenTools V2.0\\" + toolgruppe.name + ".tg"); if (textBox1.Text != String.Empty) { if (IS.creatable(textBox1.Text) == true) { if (!System.IO.File.Exists(einstellungen.path + "OpenTools V2.0\\" + textBox1.Text + ".tg")) { ToolGruppe t = new ToolGruppe(); t.Dateien = Dateien; t.Ordner = Ordner; t.Internetseiten = Internetseiten; t.name = textBox1.Text; t.save(einstellungen.path + "OpenTools V2.0\\" + textBox1.Text + ".tg"); //Wenn Grppe = Autostartgruppe --> dann auch umbennen if (einstellungen.AutostartGruppe == toolgruppe.name) { einstellungen.AutostartGruppe = t.name; einstellungen.save(); } } else { //Toolgruppe bereits vorhanden: MessageBox.Show("Toolgruppe bereits vorhanden!", "Bereits vorhanden", MessageBoxButtons.OK, MessageBoxIcon.Error); this.DialogResult = DialogResult.None; textBox1.Select(); textBox1.SelectionStart = 0; textBox1.SelectionLength = textBox1.Text.Length; } } else { MessageBox.Show("Die Zeichen \\ / ? : * \" < > | dürfen nicht verwendet werden!", "FAIL!", MessageBoxButtons.OK, MessageBoxIcon.Error); this.DialogResult = DialogResult.None; textBox1.Select(); textBox1.SelectionStart = 0; textBox1.SelectionLength = textBox1.Text.Length; } } else { MessageBox.Show("Bitte gib deiner Toolgruppe einen Namen! Sie ist sonst traurig", "Name --> Toolgruppe traurig", MessageBoxButtons.OK, MessageBoxIcon.Error); this.DialogResult = DialogResult.None; textBox1.Select(); textBox1.SelectionStart = 0; textBox1.SelectionLength = textBox1.Text.Length; } }