| 451 | #pragma endregion |
| 452 | |
| 453 | void TestExplorerCommandRoot::init(IShellItemArray* items) |
| 454 | { |
| 455 | DWORD const count = ShellItemArray{ items }.size(); |
| 456 | Print(items); |
| 457 | if (!m_hasInit) |
| 458 | { |
| 459 | if (count == 0 && hasInvokedCopyOrCut()) |
| 460 | { |
| 461 | auto pasteCommand = Microsoft::WRL::Make<SubCommand>(CopyOperation::Paste); |
| 462 | if (ptrs.empty()) |
| 463 | { |
| 464 | ptrs.push_back(pasteCommand); |
| 465 | } |
| 466 | else |
| 467 | { |
| 468 | ptrs.insert(ptrs.begin() + 2, pasteCommand); |
| 469 | } |
| 470 | m_hasInit = true; |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | |
| 475 | |
| 476 | if (count != 0) |
| 477 | { |
| 478 | ptrs.emplace_back(Microsoft::WRL::Make<SubCommand>(CopyOperation::Copy)); |
| 479 | ptrs.emplace_back(Microsoft::WRL::Make<SubCommand>(CopyOperation::Move)); |
| 480 | ptrs.emplace_back(Microsoft::WRL::Make<SubCommand>(CopyOperation::Delete)); |
| 481 | m_hasInit = true; |
| 482 | } |
| 483 | |
| 484 | if (!ptrs.empty() && std::none_of(ptrs.begin(), ptrs.end(), [items](Microsoft::WRL::ComPtr<SubCommand> const& subcommand) { |
| 485 | return subcommand->State(nullptr) == ECS_ENABLED; |
| 486 | })) |
| 487 | { |
| 488 | ptrs.emplace_back(Microsoft::WRL::Make<SubCommand>(CopyOperation::Paste)); |
| 489 | ptrs.back()->SetParentForPasteForWindows10(ShellItemArray{ items }.front().GetPtr()); |
| 490 | } |
| 491 | } |
nothing calls this directly
no test coverage detected