From fe143ab47c2b35e0bfef4c44671f8d70c624989d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Trevi=C3=B1o?= Date: Tue, 24 Oct 2023 15:58:29 -0700 Subject: [PATCH] Change Trimming to TrimMode. Set PublishTrimmed to true when setting TrimMode to full. --- ...numProvider.cs => TrimModeEnumProvider.cs} | 8 +++--- .../TrimModeValueProvider.cs | 25 +++++++++++++++++++ .../PropertyPages/BuildPropertyPage.xaml | 6 ++--- .../xlf/BuildPropertyPage.xaml.cs.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.de.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.es.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.fr.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.it.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.ja.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.ko.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.pl.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.pt-BR.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.ru.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.tr.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.zh-Hans.xlf | 10 ++++---- .../xlf/BuildPropertyPage.xaml.zh-Hant.xlf | 10 ++++---- 16 files changed, 97 insertions(+), 72 deletions(-) rename src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/{TrimmingEnumProvider.cs => TrimModeEnumProvider.cs} (87%) create mode 100644 src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimModeValueProvider.cs diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimmingEnumProvider.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimModeEnumProvider.cs similarity index 87% rename from src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimmingEnumProvider.cs rename to src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimModeEnumProvider.cs index 2d3abbd1c08..60457697b8a 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimmingEnumProvider.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimModeEnumProvider.cs @@ -5,16 +5,16 @@ namespace Microsoft.VisualStudio.ProjectSystem.VS.Properties; -[ExportDynamicEnumValuesProvider("TrimmingEnumProvider")] +[ExportDynamicEnumValuesProvider("TrimModeEnumProvider")] [AppliesTo(ProjectCapability.DotNet)] -internal class TrimmingEnumProvider : IDynamicEnumValuesProvider +internal class TrimModeEnumProvider : IDynamicEnumValuesProvider { public Task GetProviderAsync(IList? options) { - return Task.FromResult(new TrimmingEnumGenerator()); + return Task.FromResult(new TrimModeEnumGenerator()); } - private class TrimmingEnumGenerator : IDynamicEnumValuesGenerator + private class TrimModeEnumGenerator : IDynamicEnumValuesGenerator { private static readonly List s_enumValues = new() { diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimModeValueProvider.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimModeValueProvider.cs new file mode 100644 index 00000000000..a28673c40d9 --- /dev/null +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/InterceptedProjectProperties/BuildPropertyPage/TrimModeValueProvider.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information. + +using Microsoft.VisualStudio.ProjectSystem.Properties; + +namespace Microsoft.VisualStudio.ProjectSystem.VS.Properties; + +[ExportInterceptingPropertyValueProvider("TrimMode", ExportInterceptingPropertyValueProviderFile.ProjectFile)] +internal class TrimModeValueProvider : InterceptingPropertyValueProviderBase +{ + public override async Task OnSetPropertyValueAsync(string propertyName, string unevaluatedPropertyValue, IProjectProperties defaultProperties, IReadOnlyDictionary? dimensionalConditions = null) + { + // When setting the TrimMode, we also need to set the PublishTrimmed property to true. + if (string.Equals(unevaluatedPropertyValue, "full", StringComparison.OrdinalIgnoreCase)) + { + await defaultProperties.SetPropertyValueAsync("PublishTrimmed", "true"); + } + else + { + // If the user sets the TrimMode to anything other than full, set the PublishTrimmed property to false. + await defaultProperties.SetPropertyValueAsync("PublishTrimmed", "false"); + } + + return await base.OnSetPropertyValueAsync(propertyName, unevaluatedPropertyValue, defaultProperties, dimensionalConditions); + } +} diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/BuildPropertyPage.xaml b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/BuildPropertyPage.xaml index 942680e73b7..7fd44a4e3df 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/BuildPropertyPage.xaml +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/BuildPropertyPage.xaml @@ -431,12 +431,12 @@ - Cílová platforma - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Vyberte požadovanou možnost oříznutí technologie .NET pro optimalizaci velikosti a výkonu nasazení aplikace. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Ořezávání + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.de.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.de.xlf index 4c83d9f523c..b09ac85959d 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.de.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.de.xlf @@ -232,14 +232,14 @@ Zielplattform - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Wählen Sie die gewünschte .NET-Kürzungsoption aus, um die Bereitstellungsgröße und -leistung Ihrer Anwendung zu optimieren. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Trimmen + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.es.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.es.xlf index 7d5a9de8a15..c18b7862ec8 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.es.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.es.xlf @@ -232,14 +232,14 @@ Destino de la plataforma - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Seleccione la opción de recorte de .NET deseada para optimizar el rendimiento y el tamaño de implementación de la aplicación. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Recorte + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.fr.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.fr.xlf index 8a1b8ee090f..be3758d2949 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.fr.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.fr.xlf @@ -232,14 +232,14 @@ Plateforme cible - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Sélectionnez l’option de découpage .NET souhaitée pour optimiser la taille et les performances de déploiement de votre application. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Suppression + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.it.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.it.xlf index 1bd7e8e2ff0..5a14761eb4e 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.it.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.it.xlf @@ -232,14 +232,14 @@ Destinazione piattaforma - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Selezionare l'opzione di taglio .NET desiderata per ottimizzare le dimensioni e le prestazioni della distribuzione dell'applicazione. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Trimming + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ja.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ja.xlf index 419693f91f6..21fcc24d610 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ja.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ja.xlf @@ -232,14 +232,14 @@ プラットフォーム ターゲット - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - アプリケーションのデプロイ サイズとパフォーマンスを最適化するために必要な .NET トリミング オプションを選択します。 + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - トリミング + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ko.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ko.xlf index ee99ab7ced9..bcc3d2a4a8c 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ko.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ko.xlf @@ -232,14 +232,14 @@ 플랫폼 대상 - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - 애플리케이션의 배포 크기 및 성능을 최적화하기 위해 원하는 .NET 트리밍 옵션을 선택합니다. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - 트리밍 + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pl.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pl.xlf index 75126e81e09..22136e281af 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pl.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pl.xlf @@ -232,14 +232,14 @@ Platforma docelowa - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Wybierz żądaną opcję przycinania platformy .NET, aby zoptymalizować rozmiar i wydajność wdrożenia aplikacji. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Przycinanie + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pt-BR.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pt-BR.xlf index 7e628bbfa0a..a06c65b1aed 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pt-BR.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.pt-BR.xlf @@ -232,14 +232,14 @@ Destino de plataforma - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Selecione a opção de corte .NET desejada para otimizar o tamanho e o desempenho da implantação de seu aplicativo. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Filtragem + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ru.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ru.xlf index 703264c2f7d..5714350cdf2 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ru.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.ru.xlf @@ -232,14 +232,14 @@ Целевая платформа - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Выберите нужный параметр обрезки .NET для оптимизации размера и производительности развертывания приложения. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Обрезать + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.tr.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.tr.xlf index 1dbfc266941..8ee9237fca7 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.tr.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.tr.xlf @@ -232,14 +232,14 @@ Platform hedefi - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - Uygulamanızın dağıtım boyutunu ve performansını en iyi duruma getirmek için istenen .NET kırpma seçeneğini belirleyin. + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - Kırpma + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hans.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hans.xlf index 80e5a9b4e9c..e21ced2eafd 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hans.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hans.xlf @@ -232,14 +232,14 @@ 目标平台 - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - 选择所需的 .NET 剪裁选项以优化应用程序的部署大小和性能。 + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - 修整 + + Trim mode + Trim mode diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hant.xlf b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hant.xlf index 2aa8adcc991..e5655f19de7 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hant.xlf +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/PropertyPages/xlf/BuildPropertyPage.xaml.zh-Hant.xlf @@ -232,14 +232,14 @@ 平台目標 - + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - 選取所需的 .NET 修剪選項,以將應用程式的部署大小與效能最佳化。 + Select the desired .NET trimming option for optimizing your application's deployment size and performance. - - Trimming - 修剪 + + Trim mode + Trim mode