UnsafeListDictionary<TKey, TValue> Class

This dictionary doesn't ensure the items are unique. For instance, you can use it to create a list of values to serialize without spending time validating the items.

public sealed class UnsafeListDictionary<TKey, TValue> : ICollection<KeyValuePair<TKey, TValue>>, IDictionary<TKey, TValue>, IEnumerable<KeyValuePair<TKey, TValue>>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IEnumerable where TKey : notnull

Type parameters

TKey
TValue
Implements

Nested types

NameDescription
UnsafeListDictionary<TKey, TValue>.KeyCollection
UnsafeListDictionary<TKey, TValue>.ValueCollection

Constructors

NameDescription
UnsafeListDictionary()
UnsafeListDictionary(IEnumerable<KeyValuePair<TKey, TValue>>)
UnsafeListDictionary(IEnumerable<KeyValuePair<TKey, TValue>>, IEqualityComparer<TKey>?)
UnsafeListDictionary(IEqualityComparer<TKey>?)
UnsafeListDictionary(int)
UnsafeListDictionary(int, IEqualityComparer<TKey>?)

UnsafeListDictionary overloads

UnsafeListDictionary()

UnsafeListDictionary.cs
public UnsafeListDictionary()

No documentation is available.

UnsafeListDictionary(IEnumerable<KeyValuePair<TKey, TValue>>)

UnsafeListDictionary.cs
public UnsafeListDictionary(IEnumerable<KeyValuePair<TKey, TValue>> items)

No documentation is available.

UnsafeListDictionary(IEnumerable<KeyValuePair<TKey, TValue>>, IEqualityComparer<TKey>?)

UnsafeListDictionary.cs
public UnsafeListDictionary(IEnumerable<KeyValuePair<TKey, TValue>> items, IEqualityComparer<TKey>? comparer)

No documentation is available.

UnsafeListDictionary(IEqualityComparer<TKey>?)

UnsafeListDictionary.cs
public UnsafeListDictionary(IEqualityComparer<TKey>? comparer)
Parameters
comparer IEqualityComparer<TKey>?

No documentation is available.

UnsafeListDictionary(int)

UnsafeListDictionary.cs
public UnsafeListDictionary(int capacity)
Parameters
capacity int

No documentation is available.

UnsafeListDictionary(int, IEqualityComparer<TKey>?)

UnsafeListDictionary.cs
public UnsafeListDictionary(int capacity, IEqualityComparer<TKey>? comparer)
Parameters
capacity int
comparer IEqualityComparer<TKey>?

No documentation is available.

Properties

NameDescription
ComparerGets the comparer used to compare keys.
Count
KeysGets a read-only view of the keys, in insertion order. The view reflects later changes to the dictionary.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.IsReadOnly
System.Collections.Generic.IDictionary<TKey,TValue>.Keys
System.Collections.Generic.IDictionary<TKey,TValue>.Values
System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Keys
System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Values
ValuesGets a read-only view of the values, in insertion order. The view reflects later changes to the dictionary.

Gets the comparer used to compare keys.

public IEqualityComparer<TKey> Comparer { get; }
public int Count { get; }

Property value

int

No documentation is available.

Gets a read-only view of the keys, in insertion order. The view reflects later changes to the dictionary.

public UnsafeListDictionary<TKey, TValue>.KeyCollection Keys { get; }

System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.IsReadOnly

UnsafeListDictionary.cs
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly { get; }

Property value

bool

No documentation is available.

System.Collections.Generic.IDictionary<TKey,TValue>.Keys

UnsafeListDictionary.cs
ICollection<TKey> IDictionary<TKey, TValue>.Keys { get; }

Property value

ICollection<TKey>

No documentation is available.

System.Collections.Generic.IDictionary<TKey,TValue>.Values

UnsafeListDictionary.cs
ICollection<TValue> IDictionary<TKey, TValue>.Values { get; }

Property value

ICollection<TValue>

No documentation is available.

System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Keys

UnsafeListDictionary.cs
IEnumerable<TKey> IReadOnlyDictionary<TKey, TValue>.Keys { get; }

Property value

IEnumerable<TKey>

No documentation is available.

System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>.Values

UnsafeListDictionary.cs
IEnumerable<TValue> IReadOnlyDictionary<TKey, TValue>.Values { get; }

Property value

IEnumerable<TValue>

No documentation is available.

Gets a read-only view of the values, in insertion order. The view reflects later changes to the dictionary.

public UnsafeListDictionary<TKey, TValue>.ValueCollection Values { get; }

Indexers

NameDescription
this[TKey]
public TValue this[TKey key] { get; set; }

Parameters

key TKey

Property value

TValue

No documentation is available.

Methods

NameDescription
Add(KeyValuePair<TKey, TValue>)
Add(TKey, TValue)
AddRange(IEnumerable<KeyValuePair<TKey, TValue>>)
Clear()
Contains(KeyValuePair<TKey, TValue>)
ContainsKey(TKey)
GetEnumerator()
Remove(KeyValuePair<TKey, TValue>)
Remove(TKey)
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(KeyValuePair<TKey, TValue>[], int)
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>.GetEnumerator()
System.Collections.IEnumerable.GetEnumerator()
TryGetValue(TKey, TValue)

Add overloads

Add(KeyValuePair<TKey, TValue>)

UnsafeListDictionary.cs
public void Add(KeyValuePair<TKey, TValue> item)

No documentation is available.

Add(TKey, TValue)

UnsafeListDictionary.cs
public void Add(TKey key, TValue value)
Parameters
key TKey
value TValue

No documentation is available.

AddRange(IEnumerable<KeyValuePair<TKey, TValue>>)

UnsafeListDictionary.cs
public void AddRange(IEnumerable<KeyValuePair<TKey, TValue>> items)

No documentation is available.

public void Clear()

No documentation is available.

Contains(KeyValuePair<TKey, TValue>)

UnsafeListDictionary.cs
public bool Contains(KeyValuePair<TKey, TValue> item)

Parameters

item KeyValuePair<TKey, TValue>

Returns

bool

No documentation is available.

ContainsKey(TKey)

UnsafeListDictionary.cs
public bool ContainsKey(TKey key)

Parameters

key TKey

Returns

bool

No documentation is available.

public List<KeyValuePair<TKey, TValue>>.Enumerator GetEnumerator()

No documentation is available.

Remove overloads

Remove(KeyValuePair<TKey, TValue>)

UnsafeListDictionary.cs
public bool Remove(KeyValuePair<TKey, TValue> item)
Parameters
item KeyValuePair<TKey, TValue>
Returns

bool

No documentation is available.

public bool Remove(TKey key)
Parameters
key TKey
Returns

bool

No documentation is available.

System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(KeyValuePair<TKey, TValue>[], int)

UnsafeListDictionary.cs
void ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)

Parameters

array KeyValuePair<TKey, TValue>[]
arrayIndex int

No documentation is available.

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>.GetEnumerator()

UnsafeListDictionary.cs
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()

No documentation is available.

System.Collections.IEnumerable.GetEnumerator()

UnsafeListDictionary.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.

TryGetValue(TKey, TValue)

UnsafeListDictionary.cs
public bool TryGetValue(TKey key, out TValue value)

Parameters

key TKey
value TValue

Returns

bool

No documentation is available.