-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
…TrimMode to full.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string?> OnSetPropertyValueAsync(string propertyName, string unevaluatedPropertyValue, IProjectProperties defaultProperties, IReadOnlyDictionary<string, string>? 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); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.