Class OrderedHashSet<T>
A custom collection similar to HashSet{T} which only contains unique items, however this collection keeps items in order and is customizable to keep the newest or oldest equatable item
Inheritance
object
Collection<T>
KeyedCollection<T, T>
Namespace: Umbraco.Cms.Core.Collections
Assembly: Umbraco.Core.dll
Syntax
public class OrderedHashSet<T> : KeyedCollection<T, T> where T : notnull
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
View SourceOrderedHashSet(bool)
Initializes a new instance of the OrderedHashSet<T> class.
Declaration
public OrderedHashSet(bool keepOldest = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | keepOldest | When |
Methods
View SourceGetKeyForItem(T)
Declaration
protected override T GetKeyForItem(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item |
Returns
| Type | Description |
|---|---|
| T |
InsertItem(int, T)
Declaration
protected override void InsertItem(int index, T item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | |
| T | item |