Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions PolyShim/NamespaceDummies.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

// ReSharper disable RedundantUsingDirective
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable PartialTypeWithSinglePart
Expand Down
7 changes: 2 additions & 5 deletions PolyShim/Net50/DynamicallyAccessedMemberTypes.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down Expand Up @@ -29,6 +26,6 @@ internal enum DynamicallyAccessedMemberTypes
NonPublicProperties = 1024,
PublicEvents = 2048,
NonPublicEvents = 4096,
Interfaces = 8192
Interfaces = 8192,
}
#endif
5 changes: 1 addition & 4 deletions PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
9 changes: 3 additions & 6 deletions PolyShim/Net50/Environment.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand All @@ -15,7 +12,7 @@ internal static partial class PolyfillExtensions
{
extension(Environment)
{
// No Process class in .NET Standard 1.x
// No Process class in .NET Standard 1.x
#if !NETSTANDARD || NETSTANDARD2_0_OR_GREATER
// https://learn.microsoft.com/dotnet/api/system.environment.processid
public static int ProcessId
Expand All @@ -29,4 +26,4 @@ public static int ProcessId
#endif
}
}
#endif
#endif
5 changes: 1 addition & 4 deletions PolyShim/Net50/HttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if FEATURE_HTTPCLIENT
#if FEATURE_HTTPCLIENT
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/HttpContent.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if FEATURE_HTTPCLIENT
#if FEATURE_HTTPCLIENT
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/MemberNotNullAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/MemberNotNullWhenAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/ModuleInitializerAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/OSPlatformAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
11 changes: 4 additions & 7 deletions PolyShim/Net50/OperatingSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand All @@ -15,7 +12,7 @@ internal static partial class PolyfillExtensions
{
extension(OperatingSystem)
{
// Can only detect the platform on .NET Standard 1.3+
// Can only detect the platform on .NET Standard 1.3+
#if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER
// https://learn.microsoft.com/dotnet/api/system.operatingsystem.isfreebsd
public static bool IsFreeBSD() => RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD);
Expand All @@ -29,7 +26,7 @@ internal static partial class PolyfillExtensions
// https://learn.microsoft.com/dotnet/api/system.operatingsystem.iswindows
public static bool IsWindows() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

// Can only detect OS version on .NET Standard 2.0+ and .NET Core 2.0
// Can only detect OS version on .NET Standard 2.0+ and .NET Core 2.0
#if (!NETSTANDARD || NETSTANDARD2_0_OR_GREATER) && (!NETCOREAPP || NETCOREAPP2_0_OR_GREATER)
// https://learn.microsoft.com/dotnet/api/system.operatingsystem.iswindowsversionatleast
public static bool IsWindowsVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0)
Expand All @@ -54,4 +51,4 @@ public static bool IsWindowsVersionAtLeast(int major, int minor = 0, int build =
#endif
}
}
#endif
#endif
5 changes: 1 addition & 4 deletions PolyShim/Net50/Process.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if FEATURE_PROCESS
#if FEATURE_PROCESS
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/SkipLocalsInitAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/SupportedOSPlatformAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/TargetPlatformAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
28 changes: 12 additions & 16 deletions PolyShim/Net50/TaskCompletionSource.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if FEATURE_TASK
#if FEATURE_TASK
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
Expand All @@ -19,17 +16,14 @@ internal class TaskCompletionSource(object? state, TaskCreationOptions creationO
{
private readonly TaskCompletionSource<object?> _source = new(state, creationOptions);

public TaskCompletionSource(object? state) : this(state, TaskCreationOptions.None)
{
}
public TaskCompletionSource(object? state)
: this(state, TaskCreationOptions.None) { }

public TaskCompletionSource(TaskCreationOptions creationOptions) : this(null, creationOptions)
{
}
public TaskCompletionSource(TaskCreationOptions creationOptions)
: this(null, creationOptions) { }

public TaskCompletionSource() : this(null, TaskCreationOptions.None)
{
}
public TaskCompletionSource()
: this(null, TaskCreationOptions.None) { }

public Task Task => _source.Task;

Expand All @@ -39,15 +33,17 @@ public TaskCompletionSource() : this(null, TaskCreationOptions.None)

public void SetCanceled() => _source.SetCanceled();

public void SetCanceled(CancellationToken cancellationToken) => _source.SetCanceled(cancellationToken);
public void SetCanceled(CancellationToken cancellationToken) =>
_source.SetCanceled(cancellationToken);

public bool TrySetResult() => _source.TrySetResult(null);

public bool TrySetException(Exception exception) => _source.TrySetException(exception);

public bool TrySetCanceled() => _source.TrySetCanceled();

public bool TrySetCanceled(CancellationToken cancellationToken) => _source.TrySetCanceled(cancellationToken);
public bool TrySetCanceled(CancellationToken cancellationToken) =>
_source.TrySetCanceled(cancellationToken);
}
#endif
#endif
#endif
11 changes: 5 additions & 6 deletions PolyShim/Net50/TaskCompletionSourceOfT.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if FEATURE_TASK
#if FEATURE_TASK
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
Expand All @@ -21,9 +18,11 @@ internal static partial class PolyfillExtensions
public void SetCanceled(CancellationToken cancellationToken)
{
if (!source.TrySetCanceled(cancellationToken))
throw new InvalidOperationException("The task is already completed, canceled, or failed.");
throw new InvalidOperationException(
"The task is already completed, canceled, or failed."
);
}
}
}
#endif
#endif
#endif
8 changes: 2 additions & 6 deletions PolyShim/Net50/Type.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand All @@ -16,8 +13,7 @@ internal static partial class PolyfillExtensions
extension(Type type)
{
// https://learn.microsoft.com/dotnet/api/system.type.isassignableto
public bool IsAssignableTo(Type? otherType) =>
otherType?.IsAssignableFrom(type) == true;
public bool IsAssignableTo(Type? otherType) => otherType?.IsAssignableFrom(type) == true;
}
}
#endif
5 changes: 1 addition & 4 deletions PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
5 changes: 1 addition & 4 deletions PolyShim/Net50/UnsupportedOSPlatformAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand Down
12 changes: 6 additions & 6 deletions PolyShim/Net60/ArgumentNullException.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET6_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#if (NETCOREAPP && !NET6_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
Expand All @@ -16,11 +13,14 @@ internal static partial class PolyfillExtensions
extension(ArgumentNullException)
{
// https://learn.microsoft.com/dotnet/api/system.argumentnullexception.throwifnull#system-argumentnullexception-throwifnull(system-object-system-string)
public static void ThrowIfNull(object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
public static void ThrowIfNull(
object? argument,
[CallerArgumentExpression(nameof(argument))] string? paramName = null
)
{
if (argument is null)
throw new ArgumentNullException(paramName);
}
}
}
#endif
#endif
Loading
Loading