private void pasteFunction() { DirectoryInfo infoDir; FileInfo infoFile; switch (state) { case CutCopyStatus.CUT: for (int i = 0; i < cutCopyList.Length; i++) { if (Directory.Exists(cutCopyList[i])) { infoDir = new DirectoryInfo(cutCopyList[i]); Directory.Move(cutCopyList[i], Path.Combine(textBox1.Text, infoDir.Name)); } else if (File.Exists(cutCopyList[i])) { infoFile = new FileInfo(cutCopyList[i]); File.Move(cutCopyList[i], Path.Combine(textBox1.Text, infoFile.Name)); } } break; case CutCopyStatus.COPY: for (int i = 0; i < cutCopyList.Length; i++) { copy(cutCopyList[i], textBox1.Text); } break; } state = CutCopyStatus.NOCHOOSE; loadNewTree(); }
private void copyFunction() { if (listView1.SelectedItems.Count > 0) { cutCopyList = new string[listView1.SelectedItems.Count]; for (int i = 0; i < listView1.SelectedItems.Count; i++) { cutCopyList[i] = ((string)listView1.SelectedItems[i].Tag).ToString(); } state = CutCopyStatus.COPY; } }