private void CheckPaths() { String strQuery = "Select * from videos"; ArrayList alAllEntries = vdb.GetMovieList(strQuery); ArrayList alSearchPaths = vdb.GetSearchPaths(); foreach (DisplayData dd in alAllEntries) { vdb.MovieName = dd.MovieName; if (!File.Exists(vdb.Location)) { vdb.RemoveMovie(dd.MovieName); } // Remove if parent path is not a search path Boolean bRemove = true; foreach (String sp in alSearchPaths) { if (!(vdb.Location == null) && (vdb.Location.Contains(sp))) { bRemove = false; } } if (bRemove) { // It should be removed vdb.RemoveMovie(dd.MovieName); } } }
private void removeToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Confirm Delete?", "Delete", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { foreach (DataGridViewCell dgc in dgvSearchList.SelectedCells) { vdb.RemoveMovie(dgc.Value.ToString()); dgvSearchList.Rows.RemoveAt(dgc.RowIndex); } } }