Interface IPropertyBag<TContainer>
Base typed interface for implementing property bags.
Inherited Members
Namespace: Unity.Properties
Syntax
public interface IPropertyBag<TContainer> : IPropertyBag
Type Parameters
Name | Description |
---|---|
TContainer | The container type. |
Methods
Accept(IPropertyBagVisitor, ref TContainer)
Call this method to invoke Visit<TContainer>(IPropertyBag<TContainer>, ref TContainer) with the strongly typed container.
Declaration
void Accept(IPropertyBagVisitor visitor, ref TContainer container)
Parameters
Type | Name | Description |
---|---|---|
IPropertyBagVisitor | visitor | The visitor being run. |
TContainer | container | The container being visited. |
CreateInstance()
Creates and returns a new instance of
Declaration
TContainer CreateInstance()
Returns
Type | Description |
---|---|
TContainer | A new instance of |
GetProperties()
Returns an enumerator that iterates through all static properties for the type.
Declaration
PropertyCollection<TContainer> GetProperties()
Returns
Type | Description |
---|---|
PropertyCollection<TContainer> | A IEnumerator<T> structure for all properties. |
Remarks
This should return a subset properties returned by GetProperties(ref TContainer).
GetProperties(ref TContainer)
Returns an enumerator that iterates through all static and dynamic properties for the given container.
Declaration
PropertyCollection<TContainer> GetProperties(ref TContainer container)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
Returns
Type | Description |
---|---|
PropertyCollection<TContainer> | A IEnumerator<T> structure for all properties. |
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.
TryCreateInstance(out TContainer)
Tries to create a new instance of
Declaration
bool TryCreateInstance(out TContainer instance)
Parameters
Type | Name | Description |
---|---|---|
TContainer | instance | When this method returns, contains the created instance, if type construction succeeded; otherwise, the default value for |
Returns
Type | Description |
---|---|
Boolean | true if a new instance of type |