Ejemplo n.º 1
0
 /// <summary>
 /// delete sound from filesystem and db, set btns and reset picturebox
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DeleteSoundBtn_Click(object sender, EventArgs e)
 {
     toolStripStatusLabel1.Text = "Delete " + Vocab.soundpath; //set tooltip
     WMPbox.close();                                           //clear soundbox
     WMPbox.Dispose();
     if (!Utility.FileDelete(Vocab.soundpath))
     {
         MessageBox.Show("Unable to delete File (invalid path or file not found)!",
                         "Vocabulator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     db.DeleteSound(Vocab);              //delete path from db
     Vocab.soundpath            = "";
     DeleteSoundBtn.Enabled     = false; //set btns
     AddChangeSoundBtn.Text     = "Add";
     toolStripStatusLabel1.Text = "";    //refresh tooltip
 }