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();
            }
        }
示例#3
0
 public static bool Exists(string name)
 {
     BookStyle bs = new BookStyle(name);
     return File.Exists(bs.FileName);
 }
示例#4
0
 public static BookStyle LoadBookStyle(string name)
 {
     BookStyle res = new BookStyle(name);
     res.Load();
     return res;
 }