AdvisableDictionary<TKey, TValue> Class |
PostSharp.Patterns.DynamicAdvising.DynamicallyAdvisableObject
PostSharp.Patterns.Collections.AdvisableDictionary<TKey, TValue>
Namespace: PostSharp.Patterns.Collections
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
[SerializableAttribute] public class AdvisableDictionary<TKey, TValue> : DynamicallyAdvisableObject, IDynamicallyAdvisableDictionary, IDynamicallyAdvisable, IQueryInterface, IDictionary, ICollection, IEnumerable, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>
Type Parameters
- TKey
- The type of keys in the dictionary.
- TValue
- The type of values in the dictionary.
The AdvisableDictionary<TKey, TValue> type exposes the following members.
Name | Description | |
---|---|---|
AdvisableDictionary<TKey, TValue>() |
Initializes a new instance of the AdvisableDictionary<TKey, TValue> class
that is empty, has the default initial capacity, and uses the default equality comparer for the key type.
| |
AdvisableDictionary<TKey, TValue>(IDictionary<TKey, TValue>) |
Initializes a new instance of the AdvisableDictionary<TKey, TValue> class that contains elements copied from the specified IDictionary<TKey, TValue> and uses the default equality comparer for the key type.
| |
AdvisableDictionary<TKey, TValue>(IEqualityComparer<TKey>) |
Initializes a new instance of the AdvisableDictionary<TKey, TValue> that is empty, has the default initial capacity, and uses the specified equality comparer for the key type.
| |
AdvisableDictionary<TKey, TValue>(Int32) |
Initializes a new instance of the AdvisableDictionary<TKey, TValue> class
that is empty, has the specified initial capacity, and uses the default equality comparer for the key type.
| |
AdvisableDictionary<TKey, TValue>(IDictionary<TKey, TValue>, IEqualityComparer<TKey>) |
Initializes a new instance of the AdvisableDictionary<TKey, TValue> class that contains elements copied from the specified IDictionary<TKey, TValue> and uses the specified IEqualityComparer<T>.
| |
AdvisableDictionary<TKey, TValue>(Int32, IEqualityComparer<TKey>) |
Initializes a new instance of the AdvisableDictionary<TKey, TValue> that is empty, has a specified initial capacity, and uses the specified equality comparer for the key type.
| |
AdvisableDictionary<TKey, TValue>(SerializationInfo, StreamingContext) |
Deserialization constructor.
|
Name | Description | |
---|---|---|
Count | Gets the number of elements contained in the ICollection. | |
IsReadOnly | Gets a value indicating whether the IDictionary object is read-only. | |
Item | Gets or sets the element with the specified key. | |
Keys |
Gets a collection containing the keys in the AdvisableDictionary<TKey, TValue>.
| |
Values |
Gets a collection containing the values in the AdvisableDictionary<TKey, TValue>.
|
Name | Description | |
---|---|---|
Add | Adds an element with the provided key and value to the IDictionary<TKey, TValue>. | |
AddItem |
Adds an element into the underlying dictionary.
| |
Clear | Removes all elements from the IDictionary object. | |
ClearItems |
Removes all keys and items from the underlying dictionary.
| |
ContainsKey | Determines whether the IDictionary<TKey, TValue> contains an element with the specified key. | |
ContainsValue |
Determines whether the AdvisableDictionary<TKey, TValue> contains a specific value.
| |
ExecuteWithAdvices<TResult, TAction> |
Executes an action wrapped by all custom advices added to the current object.
(Inherited from DynamicallyAdvisableObject.) | |
GetAdviceEnumerator |
Gets an AdviceEnumerator<T> for the ICollectionDynamicAdvice<T> interface.
| |
GetEnumerator |
Returns an enumerator that iterates through the AdvisableDictionary<TKey, TValue>.
| |
GetObjectData | Populates a SerializationInfo with the data needed to serialize the target object. (Overrides DynamicallyAdvisableObject.GetObjectData(SerializationInfo, StreamingContext).) | |
InitializeAdvices |
Initializes the list of dynamic advices.
(Inherited from DynamicallyAdvisableObject.) | |
OnDeserialization | Runs when the entire object graph has been deserialized. (Overrides DynamicallyAdvisableObject.OnDeserialization(Object).) | |
Remove | Removes the element with the specified key from the IDictionary<TKey, TValue>. | |
RemoveItem |
Removes the value with the specific key from the underlying dictionary.
| |
SetItem |
Sets the value with the specified key in the underlying dictionary.
| |
TryGetValue | Gets the value associated with the specified key. |
Name | Description | |
---|---|---|
ToAdvisableCollection<KeyValuePair<TKey, TValue>> |
Converts an IEnumerable<T> into an AdvisableCollection<T>.
(Defined by Extensions.) | |
ToAdvisableDictionary<KeyValuePair<TKey, TValue>, TKey, TValue> |
Converts an IEnumerable<T> into a AdvisableDictionary<TKey, TValue> given a method returning the item key and a method returning the item value.
(Defined by Extensions.) | |
ToAdvisableHashSet<KeyValuePair<TKey, TValue>> |
Converts an IEnumerable<T> into an AdvisableHashSet<T>.
(Defined by Extensions.) |
To learn how to extend this class, see the AdvisableCollection<T> class documentation,