From 17630ba70a36c683a364ef6d74d87e92eeb030fa Mon Sep 17 00:00:00 2001 From: Santosh Chintalapati Date: Fri, 30 Sep 2022 14:01:16 -0700 Subject: [PATCH] Add Repair API demo from 1.3 Release WindowsAppSDK --- .../cpp-winui/DeploymentManagerSample.vcxproj | 9 ++ .../DeploymentManagerSample.vcxproj.filters | 3 +- .../DeploymentManager/cpp-winui/Project.idl | 6 ++ .../cpp-winui/SampleConfiguration.cpp | 3 +- .../cpp-winui/Scenario3_Repair.xaml | 26 +++++ .../cpp-winui/Scenario3_Repair.xaml.cpp | 94 ++++++++++++++++++ .../cpp-winui/Scenario3_Repair.xaml.h | 26 +++++ .../cs-winui/DeploymentManagerSample.csproj | 5 +- .../cs-winui/SampleConfiguration.cs | 4 +- .../cs-winui/Scenario3_Repair.xaml | 27 ++++++ .../cs-winui/Scenario3_Repair.xaml.cs | 96 +++++++++++++++++++ 11 files changed, 293 insertions(+), 6 deletions(-) create mode 100644 Samples/DeploymentManager/cpp-winui/Scenario3_Repair.xaml create mode 100644 Samples/DeploymentManager/cpp-winui/Scenario3_Repair.xaml.cpp create mode 100644 Samples/DeploymentManager/cpp-winui/Scenario3_Repair.xaml.h create mode 100644 Samples/DeploymentManager/cs-winui/Scenario3_Repair.xaml create mode 100644 Samples/DeploymentManager/cs-winui/Scenario3_Repair.xaml.cs diff --git a/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj b/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj index de36775d4..4a0fed16e 100644 --- a/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj +++ b/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj @@ -121,6 +121,9 @@ Scenario2_Initialize.xaml Code + + Scenario3_Repair.xaml + SettingsPage.xaml Code @@ -138,6 +141,9 @@ Designer + + Designer + Designer @@ -169,6 +175,9 @@ Scenario2_Initialize.xaml Code + + Scenario3_Repair.xaml + SettingsPage.xaml Code diff --git a/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj.filters b/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj.filters index f2ef19d9c..3f067349b 100644 --- a/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj.filters +++ b/Samples/DeploymentManager/cpp-winui/DeploymentManagerSample.vcxproj.filters @@ -10,6 +10,7 @@ + @@ -54,4 +55,4 @@ - \ No newline at end of file + diff --git a/Samples/DeploymentManager/cpp-winui/Project.idl b/Samples/DeploymentManager/cpp-winui/Project.idl index d6338af15..9bb10b187 100644 --- a/Samples/DeploymentManager/cpp-winui/Project.idl +++ b/Samples/DeploymentManager/cpp-winui/Project.idl @@ -18,6 +18,12 @@ namespace DeploymentManagerSample Scenario2_Initialize(); } + [default_interface] + runtimeclass Scenario3_Repair : Microsoft.UI.Xaml.Controls.Page + { + Scenario3_Repair(); + } + /* The following code is template-specific IDL. These runtime classes are the same across all C++/WinRT WinUI samples. */ diff --git a/Samples/DeploymentManager/cpp-winui/SampleConfiguration.cpp b/Samples/DeploymentManager/cpp-winui/SampleConfiguration.cpp index 89ada0333..3cff7ab03 100644 --- a/Samples/DeploymentManager/cpp-winui/SampleConfiguration.cpp +++ b/Samples/DeploymentManager/cpp-winui/SampleConfiguration.cpp @@ -17,7 +17,8 @@ namespace winrt::DeploymentManagerSample IVector implementation::MainPage::scenariosInner = single_threaded_observable_vector( { Scenario{ L"Get Status", hstring(name_of())}, - Scenario{ L"Initialize", hstring(name_of())} + Scenario{ L"Initialize", hstring(name_of())}, + Scenario{ L"Repair", hstring(name_of())} }); hstring SampleConfig::FeatureName{ L"DeploymentManager" }; diff --git a/Samples/DeploymentManager/cpp-winui/Scenario3_Repair.xaml b/Samples/DeploymentManager/cpp-winui/Scenario3_Repair.xaml new file mode 100644 index 000000000..13d188452 --- /dev/null +++ b/Samples/DeploymentManager/cpp-winui/Scenario3_Repair.xaml @@ -0,0 +1,26 @@ + + + + + + + + Repair the Windows App SDK Runtime with DeploymentManager.Repair() + +