Exemplo n.º 1
0
        private void DeleteSelectedItems()
        {
            String   path          = treeFolders.SelectedNode.FullPath;
            TreeNode thisNode      = treeFolders.SelectedNode;
            Boolean  deletedFolder = false;

            if (listFiles.SelectedItems.Count > 0)
            {
                foreach (ListViewItem item in listFiles.SelectedItems)
                {
                    if (!item.Name.Equals(".") && !item.Name.Equals(".."))
                    {
                        Console.WriteLine(path + ", " + item.Name);
                        if (myPhone.IsDirectory(path + "/" + item.Text))
                        {
                            deletedFolder = true;
                        }
                        myPhone.DeleteFromDevice(path + "/" + item.Text);
                    }
                }
            }
            if (deletedFolder)
            {
                FillTree(thisNode, path);
            }
            ShowFiles(thisNode, path);
        }