Class Grouping<TKey, TElement>
Represents a strongly typed collection of elements that share a unique key.
Implements
Inherited Members
Namespace: TheXDS.MCART.Types
Assembly: MCART.dll
Syntax
public class Grouping<TKey, TElement> : List<TElement>, IList<TElement>, ICollection<TElement>, IReadOnlyList<TElement>, IReadOnlyCollection<TElement>, IList, ICollection, IGrouping<TKey, TElement>, IEnumerable<TElement>, IEnumerable
Type Parameters
Name | Description |
---|---|
TKey | Type of key to use. |
TElement | Type of elements in the collection. |
Constructors
| Edit this page View SourceGrouping(TKey)
Initializes a new instance of the Grouping<TKey, TElement>, setting the key to use.
Declaration
public Grouping(TKey key)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | Key associated with this group of elements. |
Grouping(TKey, IEnumerable<TElement>)
Initializes a new instance of the Grouping<TKey, TElement>, setting the key to use to identify the specified elements.
Declaration
public Grouping(TKey key, IEnumerable<TElement> collection)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | Key associated with this group of elements. |
IEnumerable<TElement> | collection | Collection to associate with the specified key. |
Grouping(TKey, int)
Initializes a new instance of the Grouping<TKey, TElement>, setting the key to use and defining the capacity of the collection.
Declaration
public Grouping(TKey key, int capacity)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | Key associated with this group of elements. |
int | capacity | Initial capacity of the underlying collection. |
Properties
| Edit this page View SourceKey
Key associated with this group of elements.
Declaration
public TKey Key { get; }
Property Value
Type | Description |
---|---|
TKey |
Operators
| Edit this page View Sourceimplicit operator Grouping<TKey, TElement>(KeyValuePair<TKey, IEnumerable<TElement>>)
Implicitly converts a KeyValuePair<TKey, TValue> to a Grouping<TKey, TElement>.
Declaration
public static implicit operator Grouping<TKey, TElement>(KeyValuePair<TKey, IEnumerable<TElement>> grouping)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, IEnumerable<TElement>> | grouping | Object to convert. |
Returns
Type | Description |
---|---|
Grouping<TKey, TElement> |
implicit operator Grouping<TKey, TElement>((TKey Key, IEnumerable<TElement> Value))
Implicitly converts a Tuple<T1, T2> to a Grouping<TKey, TElement>.
Declaration
public static implicit operator Grouping<TKey, TElement>((TKey Key, IEnumerable<TElement> Value) grouping)
Parameters
Type | Name | Description |
---|---|---|
(TKey Key, IEnumerable<TElement> Value) | grouping | Object to convert. |
Returns
Type | Description |
---|---|
Grouping<TKey, TElement> |
implicit operator KeyValuePair<TKey, IEnumerable<TElement>>(Grouping<TKey, TElement>)
Implicitly converts a Grouping<TKey, TElement> to a KeyValuePair<TKey, TValue>.
Declaration
public static implicit operator KeyValuePair<TKey, IEnumerable<TElement>>(Grouping<TKey, TElement> grouping)
Parameters
Type | Name | Description |
---|---|---|
Grouping<TKey, TElement> | grouping | Object to convert. |
Returns
Type | Description |
---|---|
KeyValuePair<TKey, IEnumerable<TElement>> |
implicit operator (TKey, IEnumerable<TElement>)(Grouping<TKey, TElement>)
Implicitly converts a Grouping<TKey, TElement> to a Tuple<T1, T2>.
Declaration
public static implicit operator (TKey, IEnumerable<TElement>)(Grouping<TKey, TElement> grouping)
Parameters
Type | Name | Description |
---|---|---|
Grouping<TKey, TElement> | grouping | Object to convert. |
Returns
Type | Description |
---|---|
(TKey Key, IEnumerable<TElement> Value) |