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

Method Percent

FastCopy/RobocopyViewModel.cpp:106–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 raisePropertyChange(L"Destination");
105 }
106 double RobocopyViewModel::Percent()
107 {
108 if (!m_recordFile.has_value() || !m_countItemTask.is_done())
109 return 0;
110
111 //auto const numFiles = m_recordFile->GetNumFiles();
112 //if (numFiles == 0)
113 // return 0;
114 //
115
116 //auto const result = min(100.0, static_cast<float>(m_finishedFiles) / numFiles * 100.0);
117 //Taskbar::SetProgressValue(Global::MainHwnd, std::clamp<int>(result, 1, 100));
118 //return result;
119
120 auto const percent = static_cast<double>(m_copiedBytes) * 100.0 / m_totalSize;
121 Taskbar::SetProgressValue(Global::MainHwnd, std::clamp<int>(percent, 1, 100));
122 return percent;
123 }
124 winrt::hstring RobocopyViewModel::SpeedText()
125 {
126 return ReadableUnitConverter::Speed::ToString<wchar_t>(m_bytesPerSec).data();

Callers 1

ShowGraphButton_ClickMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected