コード例 #1
0
ファイル: WeakKeyComparer.cs プロジェクト: sizzles/ecsharp
 public WeakKeyReference(T key, WeakKeyComparer <T> comparer)
     : base(key)
 {
     // retain the object's hash code immediately so that even
     // if the target is GC'ed we will be able to find and
     // remove the dead weak reference.
     this.HashCode = comparer.GetHashCode(key);
 }
コード例 #2
0
ファイル: WeakKeyDictionary.cs プロジェクト: dadhi/ecsharp
 public WeakKeyDictionary(int capacity, IEqualityComparer <TKey> comparer)
 {
     this.comparer   = new WeakKeyComparer <TKey>(comparer);
     this.dictionary = new Dictionary <object, TValue>(capacity, this.comparer);
 }