private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { string item = ""; List <ItemNode> item_arr = new List <ItemNode>(); for (int i = 0; i < LV_item.SelectedItems.Count; i++) { ItemNode find = FindNodeLV(LV_item.SelectedItems[i]); if (find != null) { item_arr.Add(find); item += find.Info.Name + "\r\n"; } } DeleteConfirmForm f = new DeleteConfirmForm(); f.TB.Text = item; f.ShowDialog(this); if (f.Delete) { DeleteItems items = new DeleteItems() { Items = item_arr, PernamentDelete = f.CB_pernament.Checked }; Setting_UI.reflection_eventtocore.ExplorerAndManagerFile.DeletePath(items); } }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { DeleteConfirmForm d = new DeleteConfirmForm(); switch (TV_item.SelectedNode.ImageIndex) { case 0: //disk break; case 1: //folder TreeNode_ parent_node = GetRootParent(TV_item.SelectedNode); if (parent_node.ImageIndex == 0) { d.TB.Text = TV_item.SelectedNode.FullPath; //disk } else { d.TB.Text = ((CloudType)parent_node.ImageIndex).ToString() + ":" + TV_item.SelectedNode.FullPath; } d.ShowDialog(this); if (d.Delete) { DeleteItems deleteitems = new DeleteItems() { PernamentDelete = d.CB_pernament.Checked }; deleteitems.Items.Add(((TreeNode_)TV_item.SelectedNode).ExplorerNode as ItemNode); Setting_UI.reflection_eventtocore.ExplorerAndManagerFile.DeletePath(deleteitems); } break; default: //cloud d.TB.Text = ((CloudType)TV_item.SelectedNode.ImageIndex).ToString() + ":" + TV_item.SelectedNode.Text; d.CB_pernament.Enabled = false; d.ShowDialog(this); if (d.Delete) { TV_item.Nodes.Remove(TV_item.SelectedNode); Setting_UI.reflection_eventtocore.AccountsAndCloud.DeleteAccountCloud(TV_item.SelectedNode.Text, (CloudType)TV_item.SelectedNode.ImageIndex); } break; } }