Class SetPropertyBagBase<TSet, TElement>
A IPropertyBag<TContainer> implementation for a generic set of elements using the
Inherited Members
Namespace: Unity.Properties
Syntax
public class SetPropertyBagBase<TSet, TElement> : PropertyBag<TSet>, IPropertyBagRegister, IConstructor<TSet>, IConstructor, ISetPropertyBag<TSet, TElement>, ICollectionPropertyBag<TSet, TElement>, IPropertyBag<TSet>, IPropertyBag, ICollectionPropertyBagAccept<TSet>, ISetPropertyBagAccept<TSet>, ISetPropertyAccept<TSet>, IKeyedProperties<TSet, object> where TSet : ISet<TElement>
Type Parameters
Name | Description |
---|---|
TSet | The collection type. |
TElement | The element type. |
Methods
GetProperties()
Implement this method to return a PropertyCollection<TContainer> that can enumerate through all properties for the TContainer
.
Declaration
public override PropertyCollection<TSet> GetProperties()
Returns
Type | Description |
---|---|
PropertyCollection<TSet> | A PropertyCollection<TContainer> structure which can enumerate each property. |
Overrides
Implements
Remarks
This should return a subset properties returned by GetProperties(ref TContainer).
GetProperties(ref TSet)
Implement this method to return a PropertyCollection<TContainer> that can enumerate through all properties for the TContainer
.
Declaration
public override PropertyCollection<TSet> GetProperties(ref TSet container)
Parameters
Type | Name | Description |
---|---|---|
TSet | container |
Returns
Type | Description |
---|---|
PropertyCollection<TSet> | A PropertyCollection<TContainer> structure which can enumerate each property. |
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.
TryGetProperty(ref TSet, Object, out IProperty<TSet>)
Gets the property associated with the specified name.
Declaration
public bool TryGetProperty(ref TSet container, object key, out IProperty<TSet> property)
Parameters
Type | Name | Description |
---|---|---|
TSet | container | The container hosting the data. |
Object | key | The key to lookup. |
IProperty<TSet> | property | When this method returns, contains the property associated with the specified name, if the name is found; otherwise, null. |
Returns
Type | Description |
---|---|
Boolean | true if the INamedProperties<TContainer> contains a property with the specified name; otherwise, false. |
Implements
Explicit Interface Implementations
ICollectionPropertyBagAccept<TSet>.Accept(ICollectionPropertyBagVisitor, ref TSet)
Call this method to invoke Visit<TCollection, TElement>(ICollectionPropertyBag<TCollection, TElement>, ref TCollection) with the strongly typed container.
Declaration
void ICollectionPropertyBagAccept<TSet>.Accept(ICollectionPropertyBagVisitor visitor, ref TSet container)
Parameters
Type | Name | Description |
---|---|---|
ICollectionPropertyBagVisitor | visitor | The visitor being run. |
TSet | container |
Implements
ISetPropertyAccept<TSet>.Accept<TContainer>(ISetPropertyVisitor, Property<TContainer, TSet>, ref TContainer, ref TSet)
Call this method to invoke Visit<TContainer, TSet, TValue>(Property<TContainer, TSet>, ref TContainer, ref TSet).
Declaration
void ISetPropertyAccept<TSet>.Accept<TContainer>(ISetPropertyVisitor visitor, Property<TContainer, TSet> property, ref TContainer container, ref TSet dictionary)
Parameters
Type | Name | Description |
---|---|---|
ISetPropertyVisitor | visitor | The visitor being run. |
Property<TContainer, TSet> | property | The property being visited. |
TContainer | container | The container being visited. |
TSet | dictionary |
Type Parameters
Name | Description |
---|---|
TContainer | The container type. |
Implements
Remarks
This method is used to join the container, the key and the value type.
ISetPropertyBagAccept<TSet>.Accept(ISetPropertyBagVisitor, ref TSet)
Call this method to invoke Visit<TSet, TValue>(ISetPropertyBag<TSet, TValue>, ref TSet) with the strongly typed container.
Declaration
void ISetPropertyBagAccept<TSet>.Accept(ISetPropertyBagVisitor visitor, ref TSet container)
Parameters
Type | Name | Description |
---|---|---|
ISetPropertyBagVisitor | visitor | The visitor being run. |
TSet | container |