+WeakKeyReferenceDictionary

pull/2/head
Harald Wolff 2019-10-07 08:58:24 +02:00
parent e71faeca34
commit 66c996eb0c
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,31 @@
// /**
// * File: WeakKeyReferenceDictionary.cs
// * Author: haraldwolff
// *
// * This file and it's content is copyrighted by the Author and / or copyright holder.
// * Any use wihtout proper permission is illegal and may lead to legal actions.
// *
// *
// **/
using System;
using System.Runtime.CompilerServices;
namespace ln.types.collections
{
public class WeakKeyReferenceDictionary<K,V> : WeakKeyDictionary<K,V> where K:class
{
public WeakKeyReferenceDictionary()
{
}
public override bool KeyEquals(K key1, K key2)
{
return Object.ReferenceEquals(key1, key2);
}
public override int GetKeyHashcode(K key)
{
return RuntimeHelpers.GetHashCode(key);
}
}
}

View File

@ -124,6 +124,7 @@
<Compile Include="test\Test.cs" />
<Compile Include="collections\WeakValueDictionary.cs" />
<Compile Include="test\WeakValueDictionaryTests.cs" />
<Compile Include="collections\WeakKeyReferenceDictionary.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="odb\" />