| 36 | } |
| 37 | |
| 38 | winrt::Microsoft::UI::Xaml::Media::ImageSource FileInfoViewModel::Bitmap() |
| 39 | { |
| 40 | try |
| 41 | { |
| 42 | if (auto icon = GetHBitmapFromFile(m_path.data())) |
| 43 | return HBitmapToWriteableBitmap(icon); |
| 44 | } |
| 45 | catch (...) {} |
| 46 | |
| 47 | try |
| 48 | { |
| 49 | if (auto icon = GetHIconFromFile(m_path.data())) |
| 50 | return HIconToWriteableBitmap(icon); |
| 51 | } |
| 52 | catch (...) {} |
| 53 | |
| 54 | winrt::Microsoft::UI::Xaml::Media::Imaging::BitmapImage image{ winrt::Windows::Foundation::Uri{L"ms-appx:///Assets/FileDefault.ico" } }; |
| 55 | return image; |
| 56 | } |
| 57 | |
| 58 | static std::wstring GetShellPropStringFromPath(LPCWSTR pPath, PROPERTYKEY const& key) |
| 59 | { |
nothing calls this directly
no test coverage detected