-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Labels
enhancementNew feature or requestNew feature or requestlight-upRelated to light-up/adaptive-code scenariosRelated to light-up/adaptive-code scenarios
Milestone
Description
Ideally we wouldn't need to suppress a CA1416 warning (like below):
Warning CA1416: This call site is reachable on: 'Windows' 10.0.17763.0 and later. 'DisplayMonitor.IsDolbyVisionSupportedInHdrMode.get' is only supported on: 'Windows' 10.0.19041.0 and later.
By using the #pragma warning:
if (ApiInformation.IsPropertyPresent("Windows.Devices.Display.DisplayMonitor", "IsDolbyVisionSupportedInHdrMode"))
{
#pragma warning disable CA1416 // Validate platform compatibility
Console.WriteLine("IsDolbyVisionSupported: " + displayMonitor.IsDolbyVisionSupportedInHdrMode);
#pragma warning restore CA1416 // Validate platform compatibility
}We could update the analyzer to recognize the ApiInformation check so suppressing the warning isn't needed. Also see dotnet/runtime#47593
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestlight-upRelated to light-up/adaptive-code scenariosRelated to light-up/adaptive-code scenarios