Class KeyValueCollectionPropertyBag<TDictionary, TKey, TValue>
An IPropertyBag<TContainer> implementation for a generic collection of key/value pairs using the IDictionary<TKey,TValue> interface.
Inherited Members
Namespace: Unity.Properties
Syntax
public class KeyValueCollectionPropertyBag<TDictionary, TKey, TValue> : PropertyBag<TDictionary>, IPropertyBagRegister, IConstructor<TDictionary>, IConstructor, IDictionaryPropertyBag<TDictionary, TKey, TValue>, ICollectionPropertyBag<TDictionary, KeyValuePair<TKey, TValue>>, IPropertyBag<TDictionary>, IPropertyBag, ICollectionPropertyBagAccept<TDictionary>, IDictionaryPropertyBagAccept<TDictionary>, IDictionaryPropertyAccept<TDictionary>, IKeyedProperties<TDictionary, object> where TDictionary : IDictionary<TKey, TValue>
Type Parameters
Name | Description |
---|---|
TDictionary | The key/value collection type. |
TKey | The key type. |
TValue | The value type. |
Methods
GetProperties()
Returns an enumerator that iterates through all static properties for the type.
Declaration
public override PropertyCollection<TDictionary> GetProperties()
Returns
Type | Description |
---|---|
PropertyCollection<TDictionary> | A IEnumerator<T> structure for all properties. |
Overrides
Implements
Remarks
This should return a subset properties returned by GetProperties(ref TContainer).
GetProperties(ref TDictionary)
Returns an enumerator that iterates through all static and dynamic properties for the given container.
Declaration
public override PropertyCollection<TDictionary> GetProperties(ref TDictionary container)
Parameters
Type | Name | Description |
---|---|---|
TDictionary | container |
Returns
Type | Description |
---|---|
PropertyCollection<TDictionary> | A IEnumerator<T> structure for all properties. |
Overrides
Implements
Remarks
This should return all static properties returned by GetProperties() in addition to any dynamic properties. If the container is a collection type all elements will be iterated.
Explicit Interface Implementations
ICollectionPropertyBagAccept<TDictionary>.Accept(ICollectionPropertyBagVisitor, ref TDictionary)
Call this method to invoke Visit<TCollection, TElement>(ICollectionPropertyBag<TCollection, TElement>, ref TCollection) with the strongly typed container.
Declaration
void ICollectionPropertyBagAccept<TDictionary>.Accept(ICollectionPropertyBagVisitor visitor, ref TDictionary container)
Parameters
Type | Name | Description |
---|---|---|
ICollectionPropertyBagVisitor | visitor | The visitor being run. |
TDictionary | container |
Implements
IDictionaryPropertyAccept<TDictionary>.Accept<TContainer>(IDictionaryPropertyVisitor, Property<TContainer, TDictionary>, ref TContainer, ref TDictionary)
Call this method to invoke Visit<TContainer, TDictionary, TKey, TValue>(Property<TContainer, TDictionary>, ref TContainer, ref TDictionary).
Declaration
void IDictionaryPropertyAccept<TDictionary>.Accept<TContainer>(IDictionaryPropertyVisitor visitor, Property<TContainer, TDictionary> property, ref TContainer container, ref TDictionary dictionary)
Parameters
Type | Name | Description |
---|---|---|
IDictionaryPropertyVisitor | visitor | The visitor being run. |
Property<TContainer, TDictionary> | property | The property being visited. |
TContainer | container | The container being visited. |
TDictionary | dictionary | The dictionary value. |
Type Parameters
Name | Description |
---|---|
TContainer | The container type. |
Implements
Remarks
This method is used to join the container, the key and the value type.
IDictionaryPropertyBagAccept<TDictionary>.Accept(IDictionaryPropertyBagVisitor, ref TDictionary)
Call this method to invoke Visit<TDictionary, TKey, TValue>(IDictionaryPropertyBag<TDictionary, TKey, TValue>, ref TDictionary) with the strongly typed container.
Declaration
void IDictionaryPropertyBagAccept<TDictionary>.Accept(IDictionaryPropertyBagVisitor visitor, ref TDictionary container)
Parameters
Type | Name | Description |
---|---|---|
IDictionaryPropertyBagVisitor | visitor | The visitor being run. |
TDictionary | container |
Implements
IKeyedProperties<TDictionary, Object>.TryGetProperty(ref TDictionary, Object, out IProperty<TDictionary>)
Gets the property associated with the specified name.
Declaration
bool IKeyedProperties<TDictionary, object>.TryGetProperty(ref TDictionary container, object key, out IProperty<TDictionary> property)
Parameters
Type | Name | Description |
---|---|---|
TDictionary | container | |
Object | key | |
IProperty<TDictionary> | property |
Returns
Type | Description |
---|---|
Boolean | true if the INamedProperties<TContainer> contains a property with the specified name; otherwise, false. |