Пример #1
0
 /// <summary>
 /// Removes all mappings from this dictionary.
 /// </summary>
 /// <remarks>
 /// Some implementations will attempt to lock the entire dictionary
 /// (if necessary) before preceeding with the clear operation. For
 /// such implementations, the entire dictionary has to be either
 /// already locked or able to be locked for this operation to
 /// succeed.
 /// </remarks>
 /// <exception cref="InvalidOperationException">
 /// If the lock could not be succesfully obtained for some key.
 /// </exception>
 public virtual void Clear()
 {
     NamedCache.Clear();
 }
Пример #2
0
		private bool RemoveCacheInternal(NamedCache cache)
		{
			if (this.nameCaches.ContainsKey(cache.Name) && this.nameCaches[cache.Name] == cache)
			{
				if (this.nameCaches.Remove(cache.Name))
				{
					cache.Clear();

					return true;
				}
			}
			return false;
		}