diff --git a/PolyShim/List-Signatures.ps1 b/PolyShim/List-Signatures.ps1 index 1faf46e..d3edd32 100644 --- a/PolyShim/List-Signatures.ps1 +++ b/PolyShim/List-Signatures.ps1 @@ -378,8 +378,8 @@ foreach ($file in $codeFiles) { $typeKind = $match.Groups[1].Value $typeName = $match.Groups[2].Value - # Skip PolyfillExtensions classes - if ($typeName -match '^PolyfillExtensions\d*$') { + # Skip MemberPolyfills_* classes + if ($typeName -match '^MemberPolyfills_') { continue } diff --git a/PolyShim/Net100/Random.cs b/PolyShim/Net100/Random.cs index 4c08d59..bca79dd 100644 --- a/PolyShim/Net100/Random.cs +++ b/PolyShim/Net100/Random.cs @@ -7,8 +7,10 @@ using System; using System.Text; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net100_Random { extension(Random random) { diff --git a/PolyShim/Net100/TimeSpan.cs b/PolyShim/Net100/TimeSpan.cs index 47d755f..b8283e8 100644 --- a/PolyShim/Net100/TimeSpan.cs +++ b/PolyShim/Net100/TimeSpan.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net100_TimeSpan { extension(TimeSpan) { diff --git a/PolyShim/Net50/Convert.cs b/PolyShim/Net50/Convert.cs index b806648..721753f 100644 --- a/PolyShim/Net50/Convert.cs +++ b/PolyShim/Net50/Convert.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Convert { extension(Convert) { diff --git a/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs b/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs index 4e112e8..ac629d0 100644 --- a/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs +++ b/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/Enum.cs b/PolyShim/Net50/Enum.cs index 3855c69..4ebb124 100644 --- a/PolyShim/Net50/Enum.cs +++ b/PolyShim/Net50/Enum.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Enum { extension(Enum) { diff --git a/PolyShim/Net50/Environment.cs b/PolyShim/Net50/Environment.cs index 4620fdf..83dc1e3 100644 --- a/PolyShim/Net50/Environment.cs +++ b/PolyShim/Net50/Environment.cs @@ -7,8 +7,10 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Environment { extension(Environment) { diff --git a/PolyShim/Net50/HttpClient.cs b/PolyShim/Net50/HttpClient.cs index 911ac2c..3e0e30e 100644 --- a/PolyShim/Net50/HttpClient.cs +++ b/PolyShim/Net50/HttpClient.cs @@ -11,8 +11,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_HttpClient { #if FEATURE_TASK extension(HttpClient httpClient) diff --git a/PolyShim/Net50/HttpContent.cs b/PolyShim/Net50/HttpContent.cs index 16fd5d4..8484fc8 100644 --- a/PolyShim/Net50/HttpContent.cs +++ b/PolyShim/Net50/HttpContent.cs @@ -10,8 +10,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_HttpContent { #if FEATURE_TASK extension(HttpContent httpContent) diff --git a/PolyShim/Net50/IntPtr.cs b/PolyShim/Net50/IntPtr.cs index 5f29150..0dcb0f8 100644 --- a/PolyShim/Net50/IntPtr.cs +++ b/PolyShim/Net50/IntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions2 +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_IntPtr { extension(IntPtr) { diff --git a/PolyShim/Net50/MemberNotNullAttribute.cs b/PolyShim/Net50/MemberNotNullAttribute.cs index 54322fa..c5674c3 100644 --- a/PolyShim/Net50/MemberNotNullAttribute.cs +++ b/PolyShim/Net50/MemberNotNullAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/MemberNotNullWhenAttribute.cs b/PolyShim/Net50/MemberNotNullWhenAttribute.cs index cc5d160..8391dc1 100644 --- a/PolyShim/Net50/MemberNotNullWhenAttribute.cs +++ b/PolyShim/Net50/MemberNotNullWhenAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/OperatingSystem.cs b/PolyShim/Net50/OperatingSystem.cs index 74f6d61..da21fd6 100644 --- a/PolyShim/Net50/OperatingSystem.cs +++ b/PolyShim/Net50/OperatingSystem.cs @@ -7,8 +7,10 @@ using System; using System.Runtime.InteropServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_OperatingSystem { extension(OperatingSystem) { diff --git a/PolyShim/Net50/Process.cs b/PolyShim/Net50/Process.cs index c7ce48c..eb3d2b0 100644 --- a/PolyShim/Net50/Process.cs +++ b/PolyShim/Net50/Process.cs @@ -10,8 +10,10 @@ using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Process { #if FEATURE_TASK extension(Process process) diff --git a/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs b/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs index c127fa8..ee6faea 100644 --- a/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs +++ b/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/TaskCompletionSourceOfT.cs b/PolyShim/Net50/TaskCompletionSourceOfT.cs index e29048e..5a9dea8 100644 --- a/PolyShim/Net50/TaskCompletionSourceOfT.cs +++ b/PolyShim/Net50/TaskCompletionSourceOfT.cs @@ -9,8 +9,10 @@ using System; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_TaskCompletionSourceOfT { extension(TaskCompletionSource source) { diff --git a/PolyShim/Net50/Type.cs b/PolyShim/Net50/Type.cs index 73beeec..c5b30f8 100644 --- a/PolyShim/Net50/Type.cs +++ b/PolyShim/Net50/Type.cs @@ -7,8 +7,10 @@ using System; using System.Reflection; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Type { extension(Type type) { diff --git a/PolyShim/Net50/UIntPtr.cs b/PolyShim/Net50/UIntPtr.cs index f48b034..314bbda 100644 --- a/PolyShim/Net50/UIntPtr.cs +++ b/PolyShim/Net50/UIntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions3 +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_UIntPtr { extension(UIntPtr) { diff --git a/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs b/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs index dd696fa..9f9a217 100644 --- a/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs +++ b/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net60/ArgumentNullException.cs b/PolyShim/Net60/ArgumentNullException.cs index 97c0b05..3653717 100644 --- a/PolyShim/Net60/ArgumentNullException.cs +++ b/PolyShim/Net60/ArgumentNullException.cs @@ -7,8 +7,10 @@ using System; using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_ArgumentNullException { extension(ArgumentNullException) { diff --git a/PolyShim/Net60/EnumerableExtensions.cs b/PolyShim/Net60/EnumerableExtensions.cs index b5081bd..d2d055c 100644 --- a/PolyShim/Net60/EnumerableExtensions.cs +++ b/PolyShim/Net60/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/Net60/Environment.cs b/PolyShim/Net60/Environment.cs index 23a3454..cba6a8e 100644 --- a/PolyShim/Net60/Environment.cs +++ b/PolyShim/Net60/Environment.cs @@ -7,8 +7,10 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Environment { extension(Environment) { diff --git a/PolyShim/Net60/List.cs b/PolyShim/Net60/List.cs index 72a60d9..392dd08 100644 --- a/PolyShim/Net60/List.cs +++ b/PolyShim/Net60/List.cs @@ -7,8 +7,10 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_List { extension(List list) { diff --git a/PolyShim/Net60/Math.cs b/PolyShim/Net60/Math.cs index 1e44e44..13da5f1 100644 --- a/PolyShim/Net60/Math.cs +++ b/PolyShim/Net60/Math.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Math { extension(Math) { diff --git a/PolyShim/Net60/Parallel.cs b/PolyShim/Net60/Parallel.cs index b52267e..25b5412 100644 --- a/PolyShim/Net60/Parallel.cs +++ b/PolyShim/Net60/Parallel.cs @@ -11,8 +11,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Parallel { extension(Parallel) { diff --git a/PolyShim/Net60/Random.cs b/PolyShim/Net60/Random.cs index 72db8e2..532b769 100644 --- a/PolyShim/Net60/Random.cs +++ b/PolyShim/Net60/Random.cs @@ -6,6 +6,7 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; file static class RandomEx { @@ -13,7 +14,8 @@ file static class RandomEx public static Random? Shared { get; set; } } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Random { extension(Random random) { diff --git a/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs b/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs index 9d64e3d..79a31d8 100644 --- a/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs +++ b/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET6_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net60/String.cs b/PolyShim/Net60/String.cs index 2d9a3fa..f67af5c 100644 --- a/PolyShim/Net60/String.cs +++ b/PolyShim/Net60/String.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_String { extension(string str) { diff --git a/PolyShim/Net60/Task.cs b/PolyShim/Net60/Task.cs index e101010..c5fd665 100644 --- a/PolyShim/Net60/Task.cs +++ b/PolyShim/Net60/Task.cs @@ -9,8 +9,10 @@ using System; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Task { extension(Task task) { diff --git a/PolyShim/Net70/ArgumentException.cs b/PolyShim/Net70/ArgumentException.cs index 076a465..7dd603f 100644 --- a/PolyShim/Net70/ArgumentException.cs +++ b/PolyShim/Net70/ArgumentException.cs @@ -7,8 +7,10 @@ using System; using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_ArgumentException { extension(ArgumentException) { diff --git a/PolyShim/Net70/Byte.cs b/PolyShim/Net70/Byte.cs index 4869f1e..20a788d 100644 --- a/PolyShim/Net70/Byte.cs +++ b/PolyShim/Net70/Byte.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Byte { extension(byte) { diff --git a/PolyShim/Net70/DateTime.cs b/PolyShim/Net70/DateTime.cs index f89a4f9..ab6dbe8 100644 --- a/PolyShim/Net70/DateTime.cs +++ b/PolyShim/Net70/DateTime.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_DateTime { extension(DateTime) { diff --git a/PolyShim/Net70/DateTimeOffset.cs b/PolyShim/Net70/DateTimeOffset.cs index cbeae6e..3aba7bf 100644 --- a/PolyShim/Net70/DateTimeOffset.cs +++ b/PolyShim/Net70/DateTimeOffset.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_DateTimeOffset { extension(DateTimeOffset) { diff --git a/PolyShim/Net70/Decimal.cs b/PolyShim/Net70/Decimal.cs index 20144ea..86cccd5 100644 --- a/PolyShim/Net70/Decimal.cs +++ b/PolyShim/Net70/Decimal.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Decimal { extension(decimal) { diff --git a/PolyShim/Net70/Double.cs b/PolyShim/Net70/Double.cs index 8cda669..be034a7 100644 --- a/PolyShim/Net70/Double.cs +++ b/PolyShim/Net70/Double.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Double { extension(double) { diff --git a/PolyShim/Net70/EnumerableExtensions.cs b/PolyShim/Net70/EnumerableExtensions.cs index 8d5e252..1d5d3fe 100644 --- a/PolyShim/Net70/EnumerableExtensions.cs +++ b/PolyShim/Net70/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/Net70/File.cs b/PolyShim/Net70/File.cs index 2055496..ef6b200 100644 --- a/PolyShim/Net70/File.cs +++ b/PolyShim/Net70/File.cs @@ -10,8 +10,10 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/Net70/Int16.cs b/PolyShim/Net70/Int16.cs index b61920d..e043199 100644 --- a/PolyShim/Net70/Int16.cs +++ b/PolyShim/Net70/Int16.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Int16 { extension(short) { diff --git a/PolyShim/Net70/Int32.cs b/PolyShim/Net70/Int32.cs index 49b5811..b69db8f 100644 --- a/PolyShim/Net70/Int32.cs +++ b/PolyShim/Net70/Int32.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Int32 { extension(int) { diff --git a/PolyShim/Net70/Int64.cs b/PolyShim/Net70/Int64.cs index e89c396..3ada723 100644 --- a/PolyShim/Net70/Int64.cs +++ b/PolyShim/Net70/Int64.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Int64 { extension(long) { diff --git a/PolyShim/Net70/IntPtr.cs b/PolyShim/Net70/IntPtr.cs index fd0280e..2bf6c74 100644 --- a/PolyShim/Net70/IntPtr.cs +++ b/PolyShim/Net70/IntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_IntPtr { extension(IntPtr) { diff --git a/PolyShim/Net70/Regex.cs b/PolyShim/Net70/Regex.cs index b2030ac..d98b39d 100644 --- a/PolyShim/Net70/Regex.cs +++ b/PolyShim/Net70/Regex.cs @@ -7,8 +7,10 @@ using System; using System.Text.RegularExpressions; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Regex { extension(Regex regex) { diff --git a/PolyShim/Net70/RequiresDynamicCodeAttribute.cs b/PolyShim/Net70/RequiresDynamicCodeAttribute.cs index 198cdec..d0fafad 100644 --- a/PolyShim/Net70/RequiresDynamicCodeAttribute.cs +++ b/PolyShim/Net70/RequiresDynamicCodeAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net70/SByte.cs b/PolyShim/Net70/SByte.cs index 9b46bc6..94ae700 100644 --- a/PolyShim/Net70/SByte.cs +++ b/PolyShim/Net70/SByte.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_SByte { extension(sbyte) { diff --git a/PolyShim/Net70/SetsRequiredMembersAttribute.cs b/PolyShim/Net70/SetsRequiredMembersAttribute.cs index 8d59b65..ca19de7 100644 --- a/PolyShim/Net70/SetsRequiredMembersAttribute.cs +++ b/PolyShim/Net70/SetsRequiredMembersAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net70/Single.cs b/PolyShim/Net70/Single.cs index 70dfc3d..1d117b3 100644 --- a/PolyShim/Net70/Single.cs +++ b/PolyShim/Net70/Single.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Single { extension(float) { diff --git a/PolyShim/Net70/Stream.cs b/PolyShim/Net70/Stream.cs index 5b1f37b..f807e2b 100644 --- a/PolyShim/Net70/Stream.cs +++ b/PolyShim/Net70/Stream.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Stream { extension(Stream stream) { diff --git a/PolyShim/Net70/StringSyntaxAttribute.cs b/PolyShim/Net70/StringSyntaxAttribute.cs index d8992f3..ab8240e 100644 --- a/PolyShim/Net70/StringSyntaxAttribute.cs +++ b/PolyShim/Net70/StringSyntaxAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net70/TextReader.cs b/PolyShim/Net70/TextReader.cs index 08b960c..b8ee98d 100644 --- a/PolyShim/Net70/TextReader.cs +++ b/PolyShim/Net70/TextReader.cs @@ -10,8 +10,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_TextReader { extension(TextReader reader) { diff --git a/PolyShim/Net70/UInt16.cs b/PolyShim/Net70/UInt16.cs index fd553ec..511c51f 100644 --- a/PolyShim/Net70/UInt16.cs +++ b/PolyShim/Net70/UInt16.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UInt16 { extension(ushort) { diff --git a/PolyShim/Net70/UInt32.cs b/PolyShim/Net70/UInt32.cs index a423a72..69a3c30 100644 --- a/PolyShim/Net70/UInt32.cs +++ b/PolyShim/Net70/UInt32.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UInt32 { extension(uint) { diff --git a/PolyShim/Net70/UInt64.cs b/PolyShim/Net70/UInt64.cs index c8e26e6..cf8318f 100644 --- a/PolyShim/Net70/UInt64.cs +++ b/PolyShim/Net70/UInt64.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UInt64 { extension(ulong) { diff --git a/PolyShim/Net70/UIntPtr.cs b/PolyShim/Net70/UIntPtr.cs index 86259b1..5a201ef 100644 --- a/PolyShim/Net70/UIntPtr.cs +++ b/PolyShim/Net70/UIntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UIntPtr { extension(UIntPtr) { diff --git a/PolyShim/Net80/CancellationTokenSource.cs b/PolyShim/Net80/CancellationTokenSource.cs index d28a3be..8c6d76d 100644 --- a/PolyShim/Net80/CancellationTokenSource.cs +++ b/PolyShim/Net80/CancellationTokenSource.cs @@ -8,8 +8,10 @@ using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_CancellationTokenSource { extension(CancellationTokenSource cts) { diff --git a/PolyShim/Net80/EqualityComparer.cs b/PolyShim/Net80/EqualityComparer.cs index e0fba92..5494b33 100644 --- a/PolyShim/Net80/EqualityComparer.cs +++ b/PolyShim/Net80/EqualityComparer.cs @@ -9,9 +9,9 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_EqualityComparer { - [ExcludeFromCodeCoverage] private class DelegateEqualityComparer(Func equals, Func? getHashCode) : EqualityComparer { diff --git a/PolyShim/Net80/Parallel.cs b/PolyShim/Net80/Parallel.cs index a72f01a..04fd173 100644 --- a/PolyShim/Net80/Parallel.cs +++ b/PolyShim/Net80/Parallel.cs @@ -10,8 +10,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_Parallel { extension(Parallel) { diff --git a/PolyShim/Net80/Random.cs b/PolyShim/Net80/Random.cs index 7a2720e..13b36b7 100644 --- a/PolyShim/Net80/Random.cs +++ b/PolyShim/Net80/Random.cs @@ -7,8 +7,10 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_Random { extension(Random random) { diff --git a/PolyShim/Net90/Convert.cs b/PolyShim/Net90/Convert.cs index 9ac441a..efdf727 100644 --- a/PolyShim/Net90/Convert.cs +++ b/PolyShim/Net90/Convert.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_Convert { extension(Convert) { diff --git a/PolyShim/Net90/EnumerableExtensions.cs b/PolyShim/Net90/EnumerableExtensions.cs index 2cea1d0..53268e1 100644 --- a/PolyShim/Net90/EnumerableExtensions.cs +++ b/PolyShim/Net90/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/Net90/FeatureGuardAttribute.cs b/PolyShim/Net90/FeatureGuardAttribute.cs index d976edc..a33794f 100644 --- a/PolyShim/Net90/FeatureGuardAttribute.cs +++ b/PolyShim/Net90/FeatureGuardAttribute.cs @@ -1,6 +1,7 @@ #if (NETCOREAPP && !NET9_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable #pragma warning disable CS9216 + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs b/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs index 9b4809e..7d59ddb 100644 --- a/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs +++ b/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs @@ -1,6 +1,7 @@ #if (NETCOREAPP && !NET9_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable #pragma warning disable CS9216 + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net90/File.cs b/PolyShim/Net90/File.cs index 962a0a0..32a12f3 100644 --- a/PolyShim/Net90/File.cs +++ b/PolyShim/Net90/File.cs @@ -8,8 +8,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/Net90/Task.cs b/PolyShim/Net90/Task.cs index 16d0767..115f05c 100644 --- a/PolyShim/Net90/Task.cs +++ b/PolyShim/Net90/Task.cs @@ -8,8 +8,10 @@ using System.Collections.Generic; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_Task { #if FEATURE_ASYNCINTERFACES extension(Task task) diff --git a/PolyShim/Net90/TimeSpan.cs b/PolyShim/Net90/TimeSpan.cs index 3f77cf1..f20820d 100644 --- a/PolyShim/Net90/TimeSpan.cs +++ b/PolyShim/Net90/TimeSpan.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_TimeSpan { extension(TimeSpan) { diff --git a/PolyShim/NetCore10/AppContext.cs b/PolyShim/NetCore10/AppContext.cs index 68b05d9..328a436 100644 --- a/PolyShim/NetCore10/AppContext.cs +++ b/PolyShim/NetCore10/AppContext.cs @@ -11,7 +11,8 @@ using System.Reflection; using System.Runtime.Versioning; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_AppContext { extension(AppContext) { diff --git a/PolyShim/NetCore10/Enum.cs b/PolyShim/NetCore10/Enum.cs index bae7aaa..03d0d05 100644 --- a/PolyShim/NetCore10/Enum.cs +++ b/PolyShim/NetCore10/Enum.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Enum { extension(Enum enumValue) { diff --git a/PolyShim/NetCore10/EnumerableExtensions.cs b/PolyShim/NetCore10/EnumerableExtensions.cs index f436d03..edf56dd 100644 --- a/PolyShim/NetCore10/EnumerableExtensions.cs +++ b/PolyShim/NetCore10/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/NetCore10/Path.cs b/PolyShim/NetCore10/Path.cs index 1396f94..58cd1e7 100644 --- a/PolyShim/NetCore10/Path.cs +++ b/PolyShim/NetCore10/Path.cs @@ -7,8 +7,10 @@ using System.IO; using System.Linq; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Path { extension(Path) { diff --git a/PolyShim/NetCore10/Stream.cs b/PolyShim/NetCore10/Stream.cs index 22ead75..10bf10d 100644 --- a/PolyShim/NetCore10/Stream.cs +++ b/PolyShim/NetCore10/Stream.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.IO; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Stream { extension(Stream source) { diff --git a/PolyShim/NetCore10/String.cs b/PolyShim/NetCore10/String.cs index e60da93..27ce48f 100644 --- a/PolyShim/NetCore10/String.cs +++ b/PolyShim/NetCore10/String.cs @@ -7,8 +7,10 @@ using System; using System.Linq; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_String { extension(string) { diff --git a/PolyShim/NetCore10/Task.cs b/PolyShim/NetCore10/Task.cs index e427993..b164e74 100644 --- a/PolyShim/NetCore10/Task.cs +++ b/PolyShim/NetCore10/Task.cs @@ -11,13 +11,15 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; file static class TaskEx { public static Task CompletedTask { get; } = Task.FromResult(0); } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Task { extension(Task) { diff --git a/PolyShim/NetCore10/TaskCompletionSource.cs b/PolyShim/NetCore10/TaskCompletionSource.cs index 5bd27bb..aa7221e 100644 --- a/PolyShim/NetCore10/TaskCompletionSource.cs +++ b/PolyShim/NetCore10/TaskCompletionSource.cs @@ -9,8 +9,10 @@ using System; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_TaskCompletionSource { extension(TaskCompletionSource source) { diff --git a/PolyShim/NetCore10/Version.cs b/PolyShim/NetCore10/Version.cs index e211965..8ad8a3b 100644 --- a/PolyShim/NetCore10/Version.cs +++ b/PolyShim/NetCore10/Version.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Version { extension(Version) { diff --git a/PolyShim/NetCore20/CollectionExtensions.cs b/PolyShim/NetCore20/CollectionExtensions.cs index c5fb79a..3cb31f0 100644 --- a/PolyShim/NetCore20/CollectionExtensions.cs +++ b/PolyShim/NetCore20/CollectionExtensions.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP2_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming @@ -7,7 +9,8 @@ namespace System.Collections.Generic; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_CollectionExtensions { // This weird conditional compilation pattern is needed so that List-Signatures.ps1 can pick up // both of the type receivers correctly. diff --git a/PolyShim/NetCore20/Dictionary.cs b/PolyShim/NetCore20/Dictionary.cs index f9d9d97..3c77d7c 100644 --- a/PolyShim/NetCore20/Dictionary.cs +++ b/PolyShim/NetCore20/Dictionary.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Dictionary { extension(Dictionary dictionary) where TKey : notnull diff --git a/PolyShim/NetCore20/DictionaryEntry.cs b/PolyShim/NetCore20/DictionaryEntry.cs index 3113964..6310b31 100644 --- a/PolyShim/NetCore20/DictionaryEntry.cs +++ b/PolyShim/NetCore20/DictionaryEntry.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_DictionaryEntry { extension(DictionaryEntry entry) { diff --git a/PolyShim/NetCore20/Enum.cs b/PolyShim/NetCore20/Enum.cs index b324a75..00d03cd 100644 --- a/PolyShim/NetCore20/Enum.cs +++ b/PolyShim/NetCore20/Enum.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Enum { extension(Enum) { diff --git a/PolyShim/NetCore20/EnumerableExtensions.cs b/PolyShim/NetCore20/EnumerableExtensions.cs index 63f3fef..ddf81b7 100644 --- a/PolyShim/NetCore20/EnumerableExtensions.cs +++ b/PolyShim/NetCore20/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs b/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs index 5e73cb8..ca1cc45 100644 --- a/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs +++ b/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP2_0_OR_GREATER) || (NETFRAMEWORK && !NET40_OR_GREATER) || (NETSTANDARD && !NETSTANDARD2_0_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore20/File.cs b/PolyShim/NetCore20/File.cs index c62c15d..851a569 100644 --- a/PolyShim/NetCore20/File.cs +++ b/PolyShim/NetCore20/File.cs @@ -10,8 +10,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/NetCore20/HashSet.cs b/PolyShim/NetCore20/HashSet.cs index 8209aee..e969ce8 100644 --- a/PolyShim/NetCore20/HashSet.cs +++ b/PolyShim/NetCore20/HashSet.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_HashSet { extension(HashSet set) { diff --git a/PolyShim/NetCore20/KeyValuePair.cs b/PolyShim/NetCore20/KeyValuePair.cs index 8e628ee..b4f6825 100644 --- a/PolyShim/NetCore20/KeyValuePair.cs +++ b/PolyShim/NetCore20/KeyValuePair.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_KeyValuePair { extension(KeyValuePair pair) { diff --git a/PolyShim/NetCore20/MatchCollection.cs b/PolyShim/NetCore20/MatchCollection.cs index 47999d1..6642118 100644 --- a/PolyShim/NetCore20/MatchCollection.cs +++ b/PolyShim/NetCore20/MatchCollection.cs @@ -8,8 +8,10 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_MatchCollection { // MatchCollection started implementing IEnumerable in .NET Core 2.0, // but we can't implement an interface with extension methods. diff --git a/PolyShim/NetCore20/Math.cs b/PolyShim/NetCore20/Math.cs index b9f3788..6b38974 100644 --- a/PolyShim/NetCore20/Math.cs +++ b/PolyShim/NetCore20/Math.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Math { extension(Math) { diff --git a/PolyShim/NetCore20/Path.cs b/PolyShim/NetCore20/Path.cs index 6def25b..a3abf69 100644 --- a/PolyShim/NetCore20/Path.cs +++ b/PolyShim/NetCore20/Path.cs @@ -8,8 +8,10 @@ using System; using System.IO; using System.Linq; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Path { extension(Path) { diff --git a/PolyShim/NetCore20/Queue.cs b/PolyShim/NetCore20/Queue.cs index d6df5bc..7c8ae65 100644 --- a/PolyShim/NetCore20/Queue.cs +++ b/PolyShim/NetCore20/Queue.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Queue { extension(Queue queue) { diff --git a/PolyShim/NetCore20/SortedSet.cs b/PolyShim/NetCore20/SortedSet.cs index 12f2b2d..92c6ec9 100644 --- a/PolyShim/NetCore20/SortedSet.cs +++ b/PolyShim/NetCore20/SortedSet.cs @@ -7,8 +7,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_SortedSet { extension(SortedSet set) { diff --git a/PolyShim/NetCore20/String.cs b/PolyShim/NetCore20/String.cs index 2023536..3a9ba0d 100644 --- a/PolyShim/NetCore20/String.cs +++ b/PolyShim/NetCore20/String.cs @@ -8,8 +8,10 @@ using System; using System.Globalization; using System.Text; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_String { extension(string str) { diff --git a/PolyShim/NetCore20/Task.cs b/PolyShim/NetCore20/Task.cs index 012f3b3..57fedbc 100644 --- a/PolyShim/NetCore20/Task.cs +++ b/PolyShim/NetCore20/Task.cs @@ -10,8 +10,10 @@ using System.Globalization; using System.Text; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Task { extension(Task task) { diff --git a/PolyShim/NetCore20/Type.cs b/PolyShim/NetCore20/Type.cs index ba328a7..f7d17fb 100644 --- a/PolyShim/NetCore20/Type.cs +++ b/PolyShim/NetCore20/Type.cs @@ -7,8 +7,10 @@ using System; using System.Reflection; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Type { extension(Type type) { diff --git a/PolyShim/NetCore21/DateTime.cs b/PolyShim/NetCore21/DateTime.cs index 26b2a78..ff2a079 100644 --- a/PolyShim/NetCore21/DateTime.cs +++ b/PolyShim/NetCore21/DateTime.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_DateTime { extension(DateTime) { diff --git a/PolyShim/NetCore21/DateTimeOffset.cs b/PolyShim/NetCore21/DateTimeOffset.cs index 776af2c..0765053 100644 --- a/PolyShim/NetCore21/DateTimeOffset.cs +++ b/PolyShim/NetCore21/DateTimeOffset.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions2 +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_DateTimeOffset { extension(DateTimeOffset) { diff --git a/PolyShim/NetCore21/MemoryExtensions.Contains.cs b/PolyShim/NetCore21/MemoryExtensions.Contains.cs index 0046d06..565b2a5 100644 --- a/PolyShim/NetCore21/MemoryExtensions.Contains.cs +++ b/PolyShim/NetCore21/MemoryExtensions.Contains.cs @@ -14,7 +14,7 @@ namespace System; // ReadOnlySpan for older frameworks) does not include the Contains(T) method. This method was added // to the BCL in .NET Core 2.1 / .NET Standard 2.1, but the System.Memory NuGet package doesn't backport it. [ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions +internal static class MemberPolyfills_NetCore21_MemoryExtensions_Contains { extension(Span span) { diff --git a/PolyShim/NetCore21/MemoryExtensions.cs b/PolyShim/NetCore21/MemoryExtensions.cs index 29e684b..c261e1b 100644 --- a/PolyShim/NetCore21/MemoryExtensions.cs +++ b/PolyShim/NetCore21/MemoryExtensions.cs @@ -1,5 +1,7 @@ #if !FEATURE_MEMORY #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming @@ -7,7 +9,8 @@ namespace System; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_MemoryExtensions { extension(T[]? array) { diff --git a/PolyShim/NetCore21/Path.cs b/PolyShim/NetCore21/Path.cs index 0c086b2..b25dca9 100644 --- a/PolyShim/NetCore21/Path.cs +++ b/PolyShim/NetCore21/Path.cs @@ -7,6 +7,7 @@ using System; using System.IO; +using System.Diagnostics.CodeAnalysis; file static class PathEx { @@ -25,7 +26,8 @@ public static bool IsVolumeSeparator(char c) => #endif } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_Path { extension(Path) { diff --git a/PolyShim/NetCore21/Random.cs b/PolyShim/NetCore21/Random.cs index 081a2bf..58d14dd 100644 --- a/PolyShim/NetCore21/Random.cs +++ b/PolyShim/NetCore21/Random.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_Random { extension(Random random) { diff --git a/PolyShim/NetCore21/Stream.cs b/PolyShim/NetCore21/Stream.cs index bd2333e..60b1bd4 100644 --- a/PolyShim/NetCore21/Stream.cs +++ b/PolyShim/NetCore21/Stream.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_Stream { extension(Stream stream) { diff --git a/PolyShim/NetCore21/String.cs b/PolyShim/NetCore21/String.cs index e86ac77..7362ade 100644 --- a/PolyShim/NetCore21/String.cs +++ b/PolyShim/NetCore21/String.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_String { extension(string str) { diff --git a/PolyShim/NetCore21/TextReader.cs b/PolyShim/NetCore21/TextReader.cs index 5743031..824f543 100644 --- a/PolyShim/NetCore21/TextReader.cs +++ b/PolyShim/NetCore21/TextReader.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_TextReader { extension(TextReader reader) { diff --git a/PolyShim/NetCore21/TextWriter.cs b/PolyShim/NetCore21/TextWriter.cs index f3e532c..696db8a 100644 --- a/PolyShim/NetCore21/TextWriter.cs +++ b/PolyShim/NetCore21/TextWriter.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_TextWriter { extension(TextWriter writer) { diff --git a/PolyShim/NetCore30/AllowNullAttribute.cs b/PolyShim/NetCore30/AllowNullAttribute.cs index 17b9b7c..d516260 100644 --- a/PolyShim/NetCore30/AllowNullAttribute.cs +++ b/PolyShim/NetCore30/AllowNullAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/DisallowNullAttribute.cs b/PolyShim/NetCore30/DisallowNullAttribute.cs index c2f0011..db34bca 100644 --- a/PolyShim/NetCore30/DisallowNullAttribute.cs +++ b/PolyShim/NetCore30/DisallowNullAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/DoesNotReturnAttribute.cs b/PolyShim/NetCore30/DoesNotReturnAttribute.cs index 832caee..8554c57 100644 --- a/PolyShim/NetCore30/DoesNotReturnAttribute.cs +++ b/PolyShim/NetCore30/DoesNotReturnAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs b/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs index 7938e7c..b74ccc0 100644 --- a/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs +++ b/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/EnumerableExtensions.cs b/PolyShim/NetCore30/EnumerableExtensions.cs index b2bdf29..b43aa11 100644 --- a/PolyShim/NetCore30/EnumerableExtensions.cs +++ b/PolyShim/NetCore30/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/NetCore30/File.cs b/PolyShim/NetCore30/File.cs index cb02f11..50e5fc9 100644 --- a/PolyShim/NetCore30/File.cs +++ b/PolyShim/NetCore30/File.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.IO; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/NetCore30/MaybeNullAttribute.cs b/PolyShim/NetCore30/MaybeNullAttribute.cs index 06b8e85..31a6a1c 100644 --- a/PolyShim/NetCore30/MaybeNullAttribute.cs +++ b/PolyShim/NetCore30/MaybeNullAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/MaybeNullWhenAttribute.cs b/PolyShim/NetCore30/MaybeNullWhenAttribute.cs index 7b10005..b26e242 100644 --- a/PolyShim/NetCore30/MaybeNullWhenAttribute.cs +++ b/PolyShim/NetCore30/MaybeNullWhenAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/NotNullAttribute.cs b/PolyShim/NetCore30/NotNullAttribute.cs index 17c4fcf..f819898 100644 --- a/PolyShim/NetCore30/NotNullAttribute.cs +++ b/PolyShim/NetCore30/NotNullAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs b/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs index 5882a49..93c9c17 100644 --- a/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs +++ b/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/NotNullWhenAttribute.cs b/PolyShim/NetCore30/NotNullWhenAttribute.cs index b91ae1b..325cd6f 100644 --- a/PolyShim/NetCore30/NotNullWhenAttribute.cs +++ b/PolyShim/NetCore30/NotNullWhenAttribute.cs @@ -1,5 +1,6 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/OSPlatform.cs b/PolyShim/NetCore30/OSPlatform.cs index 22e191d..c451e44 100644 --- a/PolyShim/NetCore30/OSPlatform.cs +++ b/PolyShim/NetCore30/OSPlatform.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Runtime.InteropServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_OSPlatform { extension(OSPlatform) { diff --git a/PolyShim/NetCore30/Path.cs b/PolyShim/NetCore30/Path.cs index 9a8c685..c7b3b3e 100644 --- a/PolyShim/NetCore30/Path.cs +++ b/PolyShim/NetCore30/Path.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Diagnostics.CodeAnalysis; file static class PathEx { @@ -19,7 +20,8 @@ public static bool IsDirectorySeparator(char c) => #endif } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_Path { extension(Path) { diff --git a/PolyShim/NetCore30/Process.cs b/PolyShim/NetCore30/Process.cs index 722d211..0c3e5fc 100644 --- a/PolyShim/NetCore30/Process.cs +++ b/PolyShim/NetCore30/Process.cs @@ -9,8 +9,10 @@ using System.Diagnostics; using System.Linq; using System.Management; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_Process { #if FEATURE_PROCESS && FEATURE_MANAGEMENT extension(Process process) diff --git a/PolyShim/NetCore30/Stream.cs b/PolyShim/NetCore30/Stream.cs index 668f110..81b1d93 100644 --- a/PolyShim/NetCore30/Stream.cs +++ b/PolyShim/NetCore30/Stream.cs @@ -8,8 +8,10 @@ using System; using System.IO; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_Stream { extension(Stream stream) { diff --git a/PolyShim/NetCore30/TextWriter.cs b/PolyShim/NetCore30/TextWriter.cs index 97d9ca9..216aca5 100644 --- a/PolyShim/NetCore30/TextWriter.cs +++ b/PolyShim/NetCore30/TextWriter.cs @@ -8,8 +8,10 @@ using System; using System.IO; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_TextWriter { extension(TextWriter writer) { diff --git a/PolyShim/PolyfillExtensions.cs b/PolyShim/PolyfillExtensions.cs deleted file mode 100644 index 0488328..0000000 --- a/PolyShim/PolyfillExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// ReSharper disable RedundantUsingDirective -// ReSharper disable CheckNamespace -// ReSharper disable InconsistentNaming -// ReSharper disable PartialTypeWithSinglePart - -using System.Diagnostics.CodeAnalysis; - -[ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions; - -// Additional classes may be necessary to avoid collisions when an extension member -// with the same name is defined for different type within the same extension class. -// See DateTime.UnixEpoch and DateTimeOffset.UnixEpoch for an example. - -[ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions2; - -[ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions3;