/// <summary> /// Not supported by <see cref="T:DesktopSprites.Collections.LazyDictionary`2"/>. /// </summary> /// <param name="item">The parameter is not used.</param> /// <returns>The method does not return.</returns> /// <exception cref="T:System.NotSupportedException">Thrown when the method is invoked.</exception> bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item) { throw new NotSupportedException("Not supported by " + GetType().Name); }
/// <summary> /// Determines whether the <see cref="T:DesktopSprites.Collections.LazyDictionary`2"/> contains a specific value. /// </summary> /// <param name="item">The object to locate in the <see cref="T:DesktopSprites.Collections.LazyDictionary`2"/>.</param> /// <returns>Returns true if item is found in the <see cref="T:DesktopSprites.Collections.LazyDictionary`2"/>; otherwise, false. /// </returns> /// <exception cref="T:System.ArgumentNullException"><paramref name="item"/> is null.</exception> bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> item) { bool found = dictionary.TryGetValue(item.Key, out Lazy<TValue> lazy); return found ? EqualityComparer<TValue>.Default.Equals(item.Value, lazy.Value) : false; }