/// <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();
}
}