+WeakKeyReferenceDictionary
parent
e71faeca34
commit
66c996eb0c
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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\" />
|
||||
|
|
Loading…
Reference in New Issue