Beispiel #1
0
        public override async void Paste()
        {
            var action = FileAction.Copy;

            if (Clipboard.GetData("Preferred DropEffect") is Stream act)
            {
                var effectData = new byte[4];
                act.Read(effectData, 0, effectData.Length);
                action = effectData[0] == 2 ? FileAction.Move : FileAction.Copy;
            }

            if (!Clipboard.ContainsFileDropList())
            {
                return;
            }

            Items.CollectionChanged += FocusFirstPastedItem;
            var items    = Clipboard.GetFileDropList();
            var copyTask = new TaskItem("Copying");
            await Workspace.TaskManager.RunAsync(copyTask, () => { new FilesystemAction(NotificationHost).Paste(Path, items, action); });

            _undoParameter = new Tuple <string, StringCollection, FileAction>(Path, items, action);
            if (action == FileAction.Move)
            {
                Clipboard.Clear();
                SelectedItems.Foreach(i => i.IsMarkedForMove = false);
            }
        }
Beispiel #2
0
        public override void Cut()
        {
            Items.Where(i => i.IsMarkedForMove)
            .Foreach(i => i.IsMarkedForMove = false);
            SelectedItems
            .Foreach(i => i.IsMarkedForMove = true);

            SetSelection(FileAction.Move);
        }