Added FisheryLib.Collections.FishTable and Mono.Cecil extension methods
A bit of refactoring has been done too
This commit is contained in:
@@ -17,24 +17,33 @@ public partial class Guard
|
||||
/// Throws an <see cref="ArgumentException"/> when <see cref="CanRead"/> fails.
|
||||
/// </summary>
|
||||
[DoesNotReturn]
|
||||
public static void ThrowArgumentExceptionForCanRead(Stream stream, string name) => throw new ArgumentException($"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) doesn't support reading.", name);
|
||||
public static void ThrowArgumentExceptionForCanRead(Stream stream, string name)
|
||||
=> throw new ArgumentException(
|
||||
$"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) doesn't support reading.", name);
|
||||
|
||||
/// <summary>
|
||||
/// Throws an <see cref="ArgumentException"/> when <see cref="CanWrite"/> fails.
|
||||
/// </summary>
|
||||
[DoesNotReturn]
|
||||
public static void ThrowArgumentExceptionForCanWrite(Stream stream, string name) => throw new ArgumentException($"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) doesn't support writing.", name);
|
||||
public static void ThrowArgumentExceptionForCanWrite(Stream stream, string name)
|
||||
=> throw new ArgumentException(
|
||||
$"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) doesn't support writing.", name);
|
||||
|
||||
/// <summary>
|
||||
/// Throws an <see cref="ArgumentException"/> when <see cref="CanSeek"/> fails.
|
||||
/// </summary>
|
||||
[DoesNotReturn]
|
||||
public static void ThrowArgumentExceptionForCanSeek(Stream stream, string name) => throw new ArgumentException($"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) doesn't support seeking.", name);
|
||||
public static void ThrowArgumentExceptionForCanSeek(Stream stream, string name)
|
||||
=> throw new ArgumentException(
|
||||
$"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) doesn't support seeking.", name);
|
||||
|
||||
/// <summary>
|
||||
/// Throws an <see cref="ArgumentException"/> when <see cref="IsAtStartPosition"/> fails.
|
||||
/// </summary>
|
||||
[DoesNotReturn]
|
||||
public static void ThrowArgumentExceptionForIsAtStartPosition(Stream stream, string name) => throw new ArgumentException($"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) must be at position {AssertString(0)}, was at {AssertString(stream.Position)}.", name);
|
||||
public static void ThrowArgumentExceptionForIsAtStartPosition(Stream stream, string name)
|
||||
=> throw new ArgumentException(
|
||||
$"Stream {AssertString(name)} ({stream.GetType().ToTypeString()}) must be at position {AssertString(0)}, was at {AssertString(stream.Position)}.",
|
||||
name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user