System.Collections.Specialized.HybridDictionary.Clear C# (CSharp) Method

Clear() public method

public Clear ( ) : void
return void
        public void Clear() { }
        public bool Contains(object key) { throw null; }

Usage Example

Example #1
0
        /// <summary>Removes all items from the <see cref="Cache"/> object.</summary>
        public void Clear()
        {
            _rwl.AcquireWriterLock(LOCK_TIMEOUT_MSECS);
            try
            {
                if (_data.Count > 0)
                {
                    foreach (object key in _data.Keys)
                    {
                        if (key != null)
                        {
                            CacheCollectionElement element = _data[key] as CacheCollectionElement;
                            if (element != null)
                            {
                                element.IsCollectable = true;
                            }
                        }
                    }

                    _data.Clear();
                }
            }
            finally
            {
                _rwl.ReleaseWriterLock();
            }
        }
All Usage Examples Of System.Collections.Specialized.HybridDictionary::Clear