From 36115d61fa585d89f73a958fde5cf7148792d8ba Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 10 Mar 2022 16:34:36 -0500 Subject: [PATCH] Merge branch 'master' of github.com:alcexhim/MBS.Framework --- MBS.Framework.CLI/MBS.Framework.CLI.csproj | 4 +- MBS.Framework/MBS.Framework.csproj | 3 +- MBS.Framework/NativeHandle.cs | 47 ++++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 MBS.Framework/NativeHandle.cs diff --git a/MBS.Framework.CLI/MBS.Framework.CLI.csproj b/MBS.Framework.CLI/MBS.Framework.CLI.csproj index fe9817f..b06efbe 100644 --- a/MBS.Framework.CLI/MBS.Framework.CLI.csproj +++ b/MBS.Framework.CLI/MBS.Framework.CLI.csproj @@ -7,7 +7,7 @@ Library MBS.Framework.Console MBS.Framework.CLI - 4.0.2019.12 + 1.0.* true @@ -43,4 +43,4 @@ - + diff --git a/MBS.Framework/MBS.Framework.csproj b/MBS.Framework/MBS.Framework.csproj index 9d6d295..8c486cb 100644 --- a/MBS.Framework/MBS.Framework.csproj +++ b/MBS.Framework/MBS.Framework.csproj @@ -11,7 +11,7 @@ 2.0 true ..\..\Production.snk - 4.0.2021.01 + 4.0.2021.12 false @@ -127,6 +127,7 @@ + diff --git a/MBS.Framework/NativeHandle.cs b/MBS.Framework/NativeHandle.cs new file mode 100644 index 0000000..e0b9081 --- /dev/null +++ b/MBS.Framework/NativeHandle.cs @@ -0,0 +1,47 @@ +using System; +namespace MBS.Framework +{ + public class NativeHandle + { + } + public class NativeHandle : NativeHandle + { + public THandle Handle { get; private set; } + + public NativeHandle(THandle handle) + { + Handle = handle; + } + + public override int GetHashCode() + { + return Handle.GetHashCode(); + } + 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); + } + } +}