void NewFolder() { EnterName nameForm = new EnterName("Новая папка", this); nameForm.ShowDialog(); if (nameForm.result == DialogResult.OK) { Directory.CreateDirectory(Path.Combine(ActiveList.addressText.Text, nameForm.textBox1.Text)); ActiveList.UpdateContent(); } }
async Task DragDropCopy(ListFiles list, DragEventArgs e) { foreach (string f in (string[])e.Data.GetData(DataFormats.FileDrop)) { if (File.Exists(f)) { File.Copy(f, list.addressText.Text + Path.GetFileName(f), true); } else { await DirectoryCopy(f, list.addressText.Text); } list.UpdateContent(); } }