Merge branch 'master' of github.com:alcexhim/MBS.Framework
This commit is contained in:
parent
460250b7ad
commit
36115d61fa
@ -7,7 +7,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>MBS.Framework.Console</RootNamespace>
|
||||
<AssemblyName>MBS.Framework.CLI</AssemblyName>
|
||||
<ReleaseVersion>4.0.2019.12</ReleaseVersion>
|
||||
<ReleaseVersion>1.0.*</ReleaseVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\..\Production.snk</AssemblyOriginatorKeyFile>
|
||||
<ReleaseVersion>4.0.2021.01</ReleaseVersion>
|
||||
<ReleaseVersion>4.0.2021.12</ReleaseVersion>
|
||||
<SynchReleaseVersion>false</SynchReleaseVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@ -127,6 +127,7 @@
|
||||
<Compile Include="EventFilter.cs" />
|
||||
<Compile Include="EventFilterType.cs" />
|
||||
<Compile Include="EventFilterDelegate.cs" />
|
||||
<Compile Include="NativeHandle.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Logic\" />
|
||||
|
||||
47
MBS.Framework/NativeHandle.cs
Normal file
47
MBS.Framework/NativeHandle.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
namespace MBS.Framework
|
||||
{
|
||||
public class NativeHandle
|
||||
{
|
||||
}
|
||||
public class NativeHandle<THandle> : 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<THandle>)
|
||||
return Equals(obj as NativeHandle<THandle>);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool operator ==(NativeHandle<THandle> left, NativeHandle<THandle> 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<THandle> left, NativeHandle<THandle> right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user