/// <summary> /// 右键菜单粘贴事件 /// </summary> private void item_paste_Click(object sender, EventArgs e) { SelectedItemsStatus status = GetStatusOfSelectedItemsInListView(); if (status == SelectedItemsStatus.NoSelected) { if (_sourceCopyPath != string.Empty) { string targetCopyDir = GetSelectedDirPathInDirTree(); _fileManager.CopyFileOrDir(_sourceCopyPath, targetCopyDir + _sourceCopyName); //清空复制记录 _sourceCopyPath = string.Empty; _sourceCopyName = string.Empty; } } }
/// <summary> /// 右键菜单粘贴事件 /// </summary> private void item_paste_Click(object sender, EventArgs e) { List <FileInfo> fileInfos = GetSelectedFilesInListView(); SelectedFilesStatus status = GetStatusOfSelectedFilesInListView(fileInfos); if (status == SelectedFilesStatus.NoSelected) { if (_sourceCopyPath != string.Empty) { string targetCopyDir = GetCurrentDirPath(); _fileManager.CopyFileOrDir(_sourceCopyPath, Path.Combine(targetCopyDir, _sourceCopyName)); //清空复制记录 _sourceCopyPath = string.Empty; _sourceCopyName = string.Empty; } } }