Class ControllerDictionary<TKey, TValue>
Inheritance
System.Object
ControllerDictionary<TKey, TValue>
Implements
System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.IDictionary
System.Collections.ICollection
ISnapshotable<
System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.IEnumerable
Assembly: Eco.Core.dll
Syntax
public class ControllerDictionary<TKey, TValue> : ThreadSafeDictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, ISnapshotable<KeyValuePair<TKey, TValue>>, ISnapshotable, ITrackedControllerEnumerable, ITrackedEnumerable, IEnumerable
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
Constructors
ControllerDictionary(IController, String)
Declaration
public ControllerDictionary(IController parent, [ControllerPropertyName(null)] string propertyName)
Parameters
Type |
Name |
Description |
IController |
parent |
|
System.String |
propertyName |
|
Properties
Callbacks
Declaration
public TrackingCallbacks Callbacks { get; }
Property Value
Item[TKey]
Declaration
public override TValue this[TKey key] { set; }
Parameters
Type |
Name |
Description |
TKey |
key |
|
Property Value
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.Item[TKey]
Parent
Declaration
public IController Parent { get; }
Property Value
PropertyName
Declaration
public string PropertyName { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Add(TKey, TValue)
Calls 'OnAdd' callback regardless of whether the item already existed or not.
Declaration
public override void Add(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.Add(TKey, TValue)
AddOrUpdate(TKey, TValue, Func<TKey, TValue, TValue>)
Declaration
public override TValue AddOrUpdate(TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
addValue |
|
System.Func<TKey, TValue, TValue> |
updateValueFactory |
|
Returns
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.AddOrUpdate(TKey, TValue, System.Func<TKey, TValue, TValue>)
AddOrUpdate(TKey, Func<TValue>, Func<TValue, TValue>)
Declaration
public override TValue AddOrUpdate(TKey key, Func<TValue> createFunc, Func<TValue, TValue> updateFunc)
Parameters
Type |
Name |
Description |
TKey |
key |
|
System.Func<TValue> |
createFunc |
|
System.Func<TValue, TValue> |
updateFunc |
|
Returns
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.AddOrUpdate(TKey, System.Func<TValue>, System.Func<TValue, TValue>)
AddRange(IEnumerable<KeyValuePair<TKey, TValue>>)
Declaration
public override void AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
pairs |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.AddRange(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>)
Clear()
Declaration
public override void Clear()
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.Clear()
GetOrAdd(TKey, TValue)
Declaration
public override TValue GetOrAdd(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Returns
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.GetOrAdd(TKey, TValue)
GetOrAdd(TKey, Func<TKey, TValue>)
Declaration
public override TValue GetOrAdd(TKey key, Func<TKey, TValue> createFunc)
Parameters
Type |
Name |
Description |
TKey |
key |
|
System.Func<TKey, TValue> |
createFunc |
|
Returns
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.GetOrAdd(TKey, System.Func<TKey, TValue>)
GetSnapshotAndClear()
Declaration
public override IReadOnlyDictionary<TKey, TValue> GetSnapshotAndClear()
Returns
Type |
Description |
System.Collections.Generic.IReadOnlyDictionary<TKey, TValue> |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.GetSnapshotAndClear()
Initialize(IController, String)
Declaration
public void Initialize(IController parent, [ControllerPropertyName(null)] string propertyName)
Parameters
Type |
Name |
Description |
IController |
parent |
|
System.String |
propertyName |
|
Remove(TKey)
Declaration
public override bool Remove(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.Remove(TKey)
RemoveRange(IEnumerable<TKey>)
Declaration
public override ImmutableDictionary<TKey, TValue> RemoveRange(IEnumerable<TKey> keys)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TKey> |
keys |
|
Returns
Type |
Description |
System.Collections.Immutable.ImmutableDictionary<TKey, TValue> |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.RemoveRange(System.Collections.Generic.IEnumerable<TKey>)
Set(Dictionary<TKey, TValue>)
Declaration
public override void Set(Dictionary<TKey, TValue> val)
Parameters
Type |
Name |
Description |
System.Collections.Generic.Dictionary<TKey, TValue> |
val |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.Set(System.Collections.Generic.Dictionary<TKey, TValue>)
Set(ImmutableDictionary<TKey, TValue>)
Declaration
public override void Set(ImmutableDictionary<TKey, TValue> val)
Parameters
Type |
Name |
Description |
System.Collections.Immutable.ImmutableDictionary<TKey, TValue> |
val |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.Set(System.Collections.Immutable.ImmutableDictionary<TKey, TValue>)
SetItem(TKey, TValue)
Declaration
public override void SetItem(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.SetItem(TKey, TValue)
SetItems(IEnumerable<KeyValuePair<TKey, TValue>>)
Declaration
public override void SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
items |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.SetItems(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>)
TryAdd(TKey, TValue)
Declaration
public override bool TryAdd(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.TryAdd(TKey, TValue)
TryRemove(TKey, out TValue)
Declaration
public override bool TryRemove(TKey key, out TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.TryRemove(TKey, TValue)
TryRemove(KeyValuePair<TKey, TValue>)
Declaration
public override bool TryRemove(KeyValuePair<TKey, TValue> pair)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<TKey, TValue> |
pair |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Eco.Core.Utils.ThreadSafeDictionary<TKey, TValue>.TryRemove(System.Collections.Generic.KeyValuePair<TKey, TValue>)
Implements
System.Collections.Generic.IDictionary<, >
System.Collections.Generic.ICollection<>
System.Collections.Generic.IEnumerable<>
System.Collections.IDictionary
System.Collections.ICollection
System.Collections.IEnumerable
Extension Methods