MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / init

Method init

FastCopyShellExtension/dllmain.cpp:453–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451#pragma endregion
452
453void 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}

Callers

nothing calls this directly

Calls 10

PrintFunction · 0.85
hasInvokedCopyOrCutFunction · 0.85
sizeMethod · 0.80
StateMethod · 0.80
backMethod · 0.80
GetPtrMethod · 0.80
frontMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected