mirror of https://github.com/dahall/Vanara.git
Added IReadOnlyDictionary for pre-,NET 4.5
parent
0f476165ca
commit
41dfd2f760
|
@ -11,6 +11,40 @@ namespace System.Collections.Generic
|
|||
int Count { get; }
|
||||
}
|
||||
|
||||
/// <summary>Represents a generic read-only collection of key/value pairs.</summary>
|
||||
/// <typeparam name="TKey">The type of keys in the read-only dictionary.</typeparam>
|
||||
/// <typeparam name="TValue">The type of values in the read-only dictionary.</typeparam>
|
||||
public interface IReadOnlyDictionary<TKey, TValue> : IReadOnlyCollection<KeyValuePair<TKey, TValue>>
|
||||
{
|
||||
/// <summary>Determines whether the read-only dictionary contains an element that has the specified key.</summary>
|
||||
/// <param name="key">The key to locate.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true"/> if the read-only dictionary contains an element that has the specified key; otherwise, <see langword="false"/>.
|
||||
/// </returns>
|
||||
bool ContainsKey(TKey key);
|
||||
/// <summary>Gets the value that is associated with the specified key.</summary>
|
||||
/// <param name="key">The key to locate.</param>
|
||||
/// <param name="value">
|
||||
/// When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the
|
||||
/// type of the <paramref name="value"/> parameter. This parameter is passed uninitialized.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// <see langword="true"/> if the object that implements the <see cref="IReadOnlyDictionary{TKey, TValue}"/> interface contains an
|
||||
/// element that has the specified key; otherwise, <see langword="false"/>.
|
||||
/// </returns>
|
||||
bool TryGetValue(TKey key, out TValue value);
|
||||
/// <summary>Gets the element that has the specified key in the read-only dictionary.</summary>
|
||||
/// <value>The key to locate.</value>
|
||||
/// <returns>The element that has the specified key in the read-only dictionary.</returns>
|
||||
TValue this[TKey key] { get; }
|
||||
/// <summary>Gets an enumerable collection that contains the keys in the read-only dictionary.</summary>
|
||||
/// <value>An enumerable collection that contains the keys in the read-only dictionary.</value>
|
||||
IEnumerable<TKey> Keys { get; }
|
||||
/// <summary>Gets an enumerable collection that contains the values in the read-only dictionary.</summary>
|
||||
/// <value>An enumerable collection that contains the values in the read-only dictionary.</value>
|
||||
IEnumerable<TValue> Values { get; }
|
||||
}
|
||||
|
||||
/// <summary>Represents a read-only collection of elements that can be accessed by index.</summary>
|
||||
/// <typeparam name="T">The type of elements in the read-only list.</typeparam>
|
||||
/// <seealso cref="System.Collections.Generic.IReadOnlyCollection{T}"/>
|
||||
|
|
Loading…
Reference in New Issue