mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-07 16:14:03 +08:00
Use record struct in FileHeaderOffset
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
/// How many bytes precede the "%PDF-" version header in the file. In some files this 'junk' can
|
||||
/// offset all following offset bytes.
|
||||
/// </summary>
|
||||
internal readonly struct FileHeaderOffset(int value)
|
||||
internal readonly record struct FileHeaderOffset(int Value) : IEquatable<FileHeaderOffset>
|
||||
{
|
||||
public int Value => value;
|
||||
public override string ToString() => Value.ToString();
|
||||
|
||||
public bool Equals(FileHeaderOffset other)
|
||||
{
|
||||
return Value == other.Value;
|
||||
}
|
||||
|
||||
public override string ToString() => value.ToString();
|
||||
|
||||
public override bool Equals(object? obj) =>
|
||||
obj is FileHeaderOffset other && value == other.Value;
|
||||
|
||||
public override int GetHashCode() => value.GetHashCode();
|
||||
public override int GetHashCode() => Value.GetHashCode();
|
||||
}
|
6
src/UglyToad.PdfPig/Polyfills/IsExternalInitPoly.cs
Normal file
6
src/UglyToad.PdfPig/Polyfills/IsExternalInitPoly.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
#if !NET
|
||||
namespace System.Runtime.CompilerServices
|
||||
{
|
||||
internal static class IsExternalInit { }
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user