From 66c4c589061609ed5a4b1f089670c6b94f736cc6 Mon Sep 17 00:00:00 2001 From: alcexhim Date: Fri, 15 May 2015 13:45:01 -0400 Subject: [PATCH] Only move the files when the SHIFT key is down, and handle folders as well (not implemented yet) --- .../Editors/FileSystemEditor.cs | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Editors/FileSystemEditor.cs b/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Editors/FileSystemEditor.cs index b90f9125..8cb41a67 100644 --- a/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Editors/FileSystemEditor.cs +++ b/CSharp/Engines/WindowsForms/Libraries/UniversalEditor.UserInterface.WindowsForms/Editors/FileSystemEditor.cs @@ -465,7 +465,11 @@ namespace UniversalEditor.UserInterface.WindowsForms.Editors e.DataObject = dobj; - e.Effects = DragDropEffects.Copy | DragDropEffects.Move; + e.Effects = DragDropEffects.Copy; + if ((Control.ModifierKeys & Keys.ShiftKey) == Keys.ShiftKey) + { + e.Effects = DragDropEffects.Move; + } } } @@ -478,15 +482,26 @@ namespace UniversalEditor.UserInterface.WindowsForms.Editors foreach (AwesomeControls.ListView.ListViewItem lvi in items) { File file = (lvi.Data as File); - if (!System.IO.File.Exists(file.Properties["tempfile"].ToString())) + Folder folder = (lvi.Data as Folder); + if (file != null) { - // delete the file from the archive - BeginEdit(); + if (!System.IO.File.Exists(file.Properties["tempfile"].ToString())) + { + if (e.Effects == DragDropEffects.Move) + { + // delete the file from the archive + BeginEdit(); - fsom.Files.Remove(file); - lv.Items.Remove(lvi); + fsom.Files.Remove(file); + lv.Items.Remove(lvi); - EndEdit(); + EndEdit(); + } + } + } + else if (folder != null) + { + // ExtractFolder(folder); } } }