<PackageReference Include="SSH.NET" Version="2025.0.0" />

ThrowHelper

static class ThrowHelper
using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace Renci.SshNet.Common { [System.Runtime.CompilerServices.NullableContext(2)] [System.Runtime.CompilerServices.Nullable(0)] internal static class ThrowHelper { [System.Runtime.CompilerServices.NullableContext(1)] public static void ThrowObjectDisposedIf(bool condition, object instance) { if (condition) <ThrowObjectDisposedIf>g__Throw|0_0(instance); } public static void ThrowIfNull([NotNull] object argument, [System.Runtime.CompilerServices.CallerArgumentExpression("argument")] string paramName = null) { if (argument == null) <ThrowIfNull>g__Throw|1_0(paramName); } public static void ThrowIfNullOrWhiteSpace([NotNull] string argument, [System.Runtime.CompilerServices.CallerArgumentExpression("argument")] string paramName = null) { if (string.IsNullOrWhiteSpace(argument)) <ThrowIfNullOrWhiteSpace>g__Throw|2_0(argument, paramName); } public static void ThrowIfNullOrEmpty([NotNull] string argument, [System.Runtime.CompilerServices.CallerArgumentExpression("argument")] string paramName = null) { if (string.IsNullOrEmpty(argument)) <ThrowIfNullOrEmpty>g__Throw|3_0(argument, paramName); } [System.Runtime.CompilerServices.NullableContext(1)] public static void ValidateBufferArguments(byte[] buffer, int offset, int count) { ThrowIfNull(buffer, "buffer"); ThrowIfNegative(offset, "offset"); if ((uint)count > buffer.Length - offset) <ValidateBufferArguments>g__Throw|4_0(); } public static void ThrowIfNegative(long value, [System.Runtime.CompilerServices.CallerArgumentExpression("value")] string paramName = null) { if (value < 0) <ThrowIfNegative>g__Throw|5_0(value, paramName); } } }