winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

PackageInstallerInstalledStatus.cpp (1617B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #include "pch.h"
      4 #include "PackageInstallerInstalledStatus.h"
      5 #include "PackageInstallerInstalledStatus.g.cpp"
      6 #include "InstalledStatus.h"
      7 #include "PackageInstallerInfo.h"
      8 #include <wil\cppwinrt_wrl.h>
      9 
     10 namespace winrt::Microsoft::Management::Deployment::implementation
     11 {
     12     void PackageInstallerInstalledStatus::Initialize(const ::AppInstaller::Repository::InstallerInstalledStatus& installerInstalledStatus)
     13     {
     14         // Initialize m_installerInfo
     15         auto installerInfo = winrt::make_self<wil::details::module_count_wrapper<
     16             winrt::Microsoft::Management::Deployment::implementation::PackageInstallerInfo>>();
     17         installerInfo->Initialize(installerInstalledStatus.Installer);
     18         m_installerInfo = *installerInfo;
     19 
     20         // Initialize m_installedStatus
     21         for (auto const& entry : installerInstalledStatus.Status)
     22         {
     23             auto status = winrt::make_self<wil::details::module_count_wrapper<
     24                 winrt::Microsoft::Management::Deployment::implementation::InstalledStatus>>();
     25             status->Initialize(entry);
     26 
     27             m_installedStatus.Append(*status);
     28         }
     29     }
     30     winrt::Microsoft::Management::Deployment::PackageInstallerInfo PackageInstallerInstalledStatus::InstallerInfo()
     31     {
     32         return m_installerInfo;
     33     }
     34     winrt::Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Management::Deployment::InstalledStatus> PackageInstallerInstalledStatus::InstallerInstalledStatus()
     35     {
     36         return m_installedStatus.GetView();
     37     }
     38 }