From 9d88eb6eb113965daffc874ebfe06dd1d5daec8f Mon Sep 17 00:00:00 2001 From: MaxXor Date: Thu, 17 Sep 2015 19:31:40 +0200 Subject: [PATCH] Fixed #398 --- Server/Forms/FrmFileManager.cs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Server/Forms/FrmFileManager.cs b/Server/Forms/FrmFileManager.cs index de703b87b..35742060c 100644 --- a/Server/Forms/FrmFileManager.cs +++ b/Server/Forms/FrmFileManager.cs @@ -240,24 +240,24 @@ private void renameToolStripMenuItem_Click(object sender, EventArgs e) private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { - foreach (ListViewItem files in lstDirectory.SelectedItems) + int count = lstDirectory.SelectedItems.Count; + if (count == 0) return; + if (MessageBox.Show(string.Format("Are you sure you want to delete {0} file(s)?", count), + "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - PathType type = (PathType)files.Tag; - - switch (type) + foreach (ListViewItem files in lstDirectory.SelectedItems) { - case PathType.Directory: - case PathType.File: - string path = GetAbsolutePath(files.SubItems[0].Text); - string text = string.Format("Are you sure you want to delete this {0}?", type); + PathType type = (PathType)files.Tag; - if (MessageBox.Show(text, "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == - DialogResult.Yes) - { + switch (type) + { + case PathType.Directory: + case PathType.File: + string path = GetAbsolutePath(files.SubItems[0].Text); if (_connectClient != null) new Core.Packets.ServerPackets.DoPathDelete(path, type).Execute(_connectClient); - } - break; + break; + } } } }