From cac1041214e6cf4925a21de0becd5a48f7c3fd19 Mon Sep 17 00:00:00 2001 From: h3xds1nz Date: Sun, 30 Mar 2025 18:32:50 +0200 Subject: [PATCH] [StyleCleanUp] Use ArgumentOutOfRangeException throw helper (CA1512) --- src/Microsoft.DotNet.Wpf/src/.editorconfig | 3 --- .../src/PresentationCore/GlobalSuppressions.cs | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/.editorconfig b/src/Microsoft.DotNet.Wpf/src/.editorconfig index ebe14fe879a..8fcb5a50dc9 100644 --- a/src/Microsoft.DotNet.Wpf/src/.editorconfig +++ b/src/Microsoft.DotNet.Wpf/src/.editorconfig @@ -53,9 +53,6 @@ dotnet_diagnostic.CA1510.severity = suggestion # CA2211: Non-constant fields should not be visible dotnet_diagnostic.CA2211.severity = suggestion -# CA1512: Use ArgumentOutOfRangeException throw helper -dotnet_diagnostic.CA1512.severity = suggestion - # CA1513: Use ObjectDisposedException throw helper dotnet_diagnostic.CA1513.severity = suggestion diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/GlobalSuppressions.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/GlobalSuppressions.cs index 1e2ad3e04e1..cac7a30e31d 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/GlobalSuppressions.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/GlobalSuppressions.cs @@ -32,3 +32,6 @@ [assembly: SuppressMessage("Usage", "CA2201:Do not raise reserved exception types", Justification = "Compat", Scope = "member", Target = "~M:System.Windows.Clipboard.IsCurrent(System.Windows.IDataObject)~System.Boolean")] [assembly: SuppressMessage("Usage", "CA2201:Do not raise reserved exception types", Justification = "Compat", Scope = "member", Target = "~M:System.Windows.DataObject.System#Runtime#InteropServices#ComTypes#IDataObject#EnumFormatEtc(System.Runtime.InteropServices.ComTypes.DATADIR)~System.Runtime.InteropServices.ComTypes.IEnumFORMATETC")] [assembly: SuppressMessage("Usage", "CA2201:Do not raise reserved exception types", Justification = "Compat", Scope = "member", Target = "~M:System.Windows.OleServicesContext.SetDispatcherThread")] + +// TODO: Remove these when analyzer issue is fixed (https://github.com/dotnet/roslyn-analyzers/issues/7617) +[assembly: SuppressMessage("Maintainability", "CA1512:Use ArgumentOutOfRangeException throw helper", Justification = "Analyzer bug: https://github.com/dotnet/roslyn-analyzers/issues/7617", Scope = "member", Target = "~M:System.Windows.Interop.D3DImage.TryLock(System.Windows.Duration)~System.Boolean")]