Exemplo n.º 1
0
        public void FolderClick(object sender, KeyEventArgs e)
        {
            string folder = ((TreeViewItem)sender).Tag.ToString();

            if (e.Key == Key.F6)
            {
                IExplorerObject obj = Buffer.getInstance().ExpObj;
                if (obj != null)
                {
                    obj.Paste(folder);
                    FillFileTree(CurrentLocation);
                    RefreshSubFolders((TreeViewItem)sender);
                }
            }
            if (e.Key == Key.F5)
            {
                new Folder(folder).Copy();
            }
            if (e.Key == Key.F4)
            {
                new Folder(folder).Cut();
            }
            if (e.Key == Key.F8)
            {
                new Folder(folder).Delete();
                var parent = (TreeViewItem)((TreeViewItem)sender).Parent;
                RefreshSubFolders(parent);
                FileTree.Items.Clear();
            }
            e.Handled = true;
        }
Exemplo n.º 2
0
        private void PasteClick(object sender, RoutedEventArgs e)
        {
            TreeViewItem lselected = (TreeViewItem)leftFolderTree.SelectedItem;
            TreeViewItem rselected = (TreeViewItem)rightFolderTree.SelectedItem;

            if (lselected != null)
            {
                IExplorerObject obj = Buffer.getInstance().ExpObj;
                if (obj != null)
                {
                    obj.Paste(lselected.Tag.ToString());
                    left.FillFileTree(left.CurrentLocation);
                    left.RefreshSubFolders(lselected);
                    return;
                }
            }
            if (rselected != null)
            {
                IExplorerObject obj = Buffer.getInstance().ExpObj;
                if (obj != null)
                {
                    obj.Paste(lselected.Tag.ToString());
                    right.FillFileTree(left.CurrentLocation);
                    right.RefreshSubFolders(lselected);
                    return;
                }
            }
        }