private void OnDeleteClick(object source, EventArgs e) { MyFile myFile = (MyFile)source; DeleteAsk deleteAsk = new DeleteAsk(myFile.GetName()); deleteAsk.ShowDialog(); if (deleteAsk.DialogResult == true) { //File.Delete(myFile.GetPath()); } //MessageBox.Show("Usunięto: " + myFile.GetPath()); LoadFiles(PathBox.Text, false); }
private void OnDeleteDirectory(object source, EventArgs e) { MyDirectory directory = (MyDirectory)source; DeleteAsk deleteAsk = new DeleteAsk(directory.GetName()); deleteAsk.ShowDialog(); if (deleteAsk.DialogResult == true) { if (Directory.Exists(directory.GetPath())) { Directory.Delete(directory.GetPath(), true); } } //MessageBox.Show("Usunieto: " + directory.GetName()); LoadFiles(PathBox.Text, false); }