System.Collections.Specialized.HybridDictionary.Remove C# (CSharp) Метод

Remove() публичный Метод

public Remove ( object key ) : void
key object
Результат void
        public void Remove(object key) { }
        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }

Usage Example

Пример #1
0
        /// <summary>
        /// Inserts an item into the <see cref="Cache"/> object with a specified lifetime using a cache key to reference its location.
        /// </summary>
        /// <param name="key">The cache key used to reference the item.</param>
        /// <param name="value">The object to be inserted into the cache.</param>
        /// <param name="lifetime">The lifetime of the inserted item (i.e. is it expendable or not).</param>
        public void Insert(object key, object value, CacheItemLifetime lifetime)
        {
            if (key != null)
            {
                _rwl.AcquireWriterLock(LOCK_TIMEOUT_MSECS);
                try
                {
                    // remove any existing item for this key
                    CacheCollectionElement element = _data[key] as CacheCollectionElement;
                    if (element != null)
                    {
                        element.IsCollectable = true;
                        _data.Remove(key);
                    }

                    // add new item
                    element    = new CacheCollectionElement(value, lifetime);
                    _data[key] = element;
                }
                finally
                {
                    _rwl.ReleaseWriterLock();
                }
            }
            else
            {
                throw new ArgumentNullException("key");
            }
        }
All Usage Examples Of System.Collections.Specialized.HybridDictionary::Remove