コード例 #1
0
        public override void Add(TKey key, TValue value)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            WeakReference <TKey> weakKey = new WeakKeyReference <TKey>(key, comparer);

            dictionary.Add(weakKey, value);
        }
コード例 #2
0
        protected override void SetValue(TKey key, TValue value)
        {
            WeakReference <TKey> weakKey = new WeakKeyReference <TKey>(key, comparer);

            dictionary[weakKey] = value;
        }