private void copyToolStripMenuItem_Click(object sender, EventArgs e) { List <String> files = new List <String>(); foreach (int index in galleryContextMenuItems) { files.Add(galleryImagePaths[index]); } ClipboardUtils.CopyFiles(files); }
public static void CutFile(String file) { FileSystemInfo fsinfo = null; if (File.Exists(file)) { fsinfo = new FileInfo(file); } else if (Directory.Exists(file)) { fsinfo = new DirectoryInfo(file); } ClipboardUtils.PutFilesOnClipboard( new List <FileSystemInfo> { fsinfo }, DragDropEffects.Move); }
public static void CutFiles(IEnumerable <String> filesAndFolders) { ClipboardUtils.PutFilesOnClipboard( ClipboardUtils.GetFileSystemInfoList(filesAndFolders), DragDropEffects.Move); }