| 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(); |
no outgoing calls
no test coverage detected