using System; namespace MBS.Framework { public class NativeHandle { } public class NativeHandle : NativeHandle, IEquatable> { public THandle Handle { get; private set; } public NativeHandle(THandle handle) { Handle = handle; } public override int GetHashCode() { return Handle.GetHashCode(); } public bool Equals(NativeHandle other) { return this.Handle.Equals(other.Handle); } public override bool Equals(object obj) { if ((object)obj == null && (object)this == null) return true; if ((object)obj == null || (object)this == null) return false; if (obj is NativeHandle) return Equals(obj as NativeHandle); return false; } public static bool operator ==(NativeHandle left, NativeHandle right) { if ((object)left == null && (object)right == null) return true; if ((object)left == null || (object)right == null) return false; return left.Equals(right); } public static bool operator !=(NativeHandle left, NativeHandle right) { return !left.Equals(right); } } }