PackageMatchFilter.cpp (1782B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #include "pch.h" 4 #include <winget/RepositorySource.h> 5 #include "Workflows/WorkflowBase.h" 6 #include "Converters.h" 7 #pragma warning( push ) 8 #pragma warning ( disable : 4467 6388) 9 // 6388 Allow CreateInstance. 10 #include <wil\cppwinrt_wrl.h> 11 // 4467 Allow use of uuid attribute for com object creation. 12 #include "PackageMatchFilter.h" 13 #pragma warning( pop ) 14 #include "PackageMatchFilter.g.cpp" 15 #include "Helpers.h" 16 17 namespace winrt::Microsoft::Management::Deployment::implementation 18 { 19 void PackageMatchFilter::Initialize(::AppInstaller::Repository::PackageMatchFilter matchFilter) 20 { 21 m_value = winrt::to_hstring(matchFilter.Value); 22 m_matchField = GetDeploymentMatchField(matchFilter.Field); 23 m_packageFieldMatchOption = GetDeploymentMatchOption(matchFilter.Type); 24 } 25 winrt::Microsoft::Management::Deployment::PackageFieldMatchOption PackageMatchFilter::Option() 26 { 27 return m_packageFieldMatchOption; 28 } 29 void PackageMatchFilter::Option(winrt::Microsoft::Management::Deployment::PackageFieldMatchOption const& value) 30 { 31 m_packageFieldMatchOption = value; 32 } 33 winrt::Microsoft::Management::Deployment::PackageMatchField PackageMatchFilter::Field() 34 { 35 return m_matchField; 36 } 37 void PackageMatchFilter::Field(winrt::Microsoft::Management::Deployment::PackageMatchField const& value) 38 { 39 m_matchField = value; 40 } 41 hstring PackageMatchFilter::Value() 42 { 43 return hstring(m_value); 44 } 45 void PackageMatchFilter::Value(hstring const& value) 46 { 47 m_value = value; 48 } 49 50 CoCreatableMicrosoftManagementDeploymentClass(PackageMatchFilter); 51 }