private void button1_Click(object sender, EventArgs e) { if (!BookStyle.Exists(tbnewname.Text)) { BookStyle bs = new BookStyle(tbnewname.Text); bs.Save(); LoadBsList(); } }
private void button3_Click(object sender, EventArgs e) { if (lbbookstyles.SelectedIndex < 0) return; string name = (string)lbbookstyles.Items[lbbookstyles.SelectedIndex]; if (MessageBox.Show("Opravdu vymazat styl zpìvníku " + name + "?", "Zpìvníkátor", MessageBoxButtons.YesNo) == DialogResult.Yes) { BookStyle bs = new BookStyle(name); File.Delete(bs.FileName); LoadBsList(); } }
public static bool Exists(string name) { BookStyle bs = new BookStyle(name); return File.Exists(bs.FileName); }
public static BookStyle LoadBookStyle(string name) { BookStyle res = new BookStyle(name); res.Load(); return res; }