RaspberryIO_26/Swan.Lite/Collections/IDataDictionary`2.cs

33 lines
1.7 KiB
C#
Raw Normal View History

2019-12-04 18:57:18 +01:00
using System;
using System.Collections.Generic;
2019-12-08 19:54:52 +01:00
namespace Swan.Collections {
/// <summary>
/// Represents a generic collection of key/value pairs that does not store
/// null values.
/// </summary>
/// <typeparam name="TKey">The type of keys in the dictionary. This must be a reference type.</typeparam>
/// <typeparam name="TValue">The type of values in the dictionary. This must be a reference type.</typeparam>
public interface IDataDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue> where TKey : class where TValue : class {
2019-12-04 18:57:18 +01:00
/// <summary>
2019-12-08 19:54:52 +01:00
/// Gets a value that indicates whether the <see cref="IDataDictionary{TKey,TValue}"/> is empty.
2019-12-04 18:57:18 +01:00
/// </summary>
2019-12-08 19:54:52 +01:00
/// <value>
/// <see langword="true"/> if the <see cref="IDataDictionary{TKey,TValue}"/> is empty; otherwise, <see langword="false"/>.
/// </value>
Boolean IsEmpty {
get;
}
/// <summary>
/// Attempts to remove and return the value that has the specified key from the <see cref="IDataDictionary{TKey,TValue}"/>.
/// </summary>
/// <param name="key">The key of the element to remove and return.</param>
/// <param name="value">When this method returns, the value removed from the <see cref="IDataDictionary{TKey,TValue}"/>,
/// if the key is found; otherwise, <see langword="null"/>. This parameter is passed uninitialized.</param>
/// <returns><see langword="true"/> if the value was removed successfully; otherwise, <see langword="false"/>.</returns>
/// <exception cref="ArgumentNullException"><paramref name="key"/> is <see langword="null"/>.</exception>
Boolean TryRemove(TKey key, out TValue value);
}
2019-12-04 18:57:18 +01:00
}