32 lines
776 B
C#
32 lines
776 B
C#
|
// /**
|
|||
|
// * 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.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);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|