mirror of https://github.com/dahall/Vanara.git
Added support for IComparable
parent
f7dd0a9cf6
commit
6cd364624e
|
@ -5,7 +5,7 @@ namespace Vanara.PInvoke
|
|||
{
|
||||
/// <summary>Managed instance of the SIZE_T type.</summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SizeT : IEquatable<SizeT>, IComparable<SizeT>, IConvertible
|
||||
public struct SizeT : IEquatable<SizeT>, IComparable<SizeT>, IConvertible, IComparable
|
||||
{
|
||||
private UIntPtr val;
|
||||
|
||||
|
@ -79,6 +79,9 @@ namespace Vanara.PInvoke
|
|||
/// <inheritdoc/>
|
||||
public string ToString(IFormatProvider provider) => Value.ToString(provider);
|
||||
|
||||
/// <inheritdoc/>
|
||||
int IComparable.CompareTo(object obj) => Value.CompareTo(Convert.ChangeType(obj, typeof(ulong)));
|
||||
|
||||
/// <inheritdoc/>
|
||||
bool IConvertible.ToBoolean(IFormatProvider provider) => ((IConvertible)Value).ToBoolean(provider);
|
||||
|
||||
|
|
Loading…
Reference in New Issue