Class PropertyContainer
Namespace: Unity.Properties
Syntax
public static class PropertyContainer
Methods
Construct<TDstContainer, TSrcContainer>(ref TDstContainer, ref TSrcContainer, PropertyContainerConstructOptions)
Declaration
public static VisitResult Construct<TDstContainer, TSrcContainer>(ref TDstContainer dstContainer, ref TSrcContainer srcContainer, PropertyContainerConstructOptions options = default(PropertyContainerConstructOptions))
Parameters
Type | Name | Description |
---|---|---|
TDstContainer | dstContainer | |
TSrcContainer | srcContainer | |
PropertyContainerConstructOptions | options |
Returns
Type | Description |
---|---|
VisitResult |
Type Parameters
Name | Description |
---|---|
TDstContainer | |
TSrcContainer |
GetCountAtPath<TContainer>(ref TContainer, PropertyPath)
Gets the count of the collection property with the given path for the given container.
Declaration
public static int GetCountAtPath<TContainer>(ref TContainer container, PropertyPath propertyPath)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
PropertyPath | propertyPath | The property path to get the count from. |
Returns
Type | Description |
---|---|
Int32 | The collection count. |
Type Parameters
Name | Description |
---|---|
TContainer |
GetValue<TContainer, TValue>(ref TContainer, String)
Gets the value of the property with the given name for the given container.
Declaration
public static TValue GetValue<TContainer, TValue>(ref TContainer container, string name)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
String | name | The property name to get. |
Returns
Type | Description |
---|---|
TValue | The value of the property converted to the given type. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
GetValueAtPath<TContainer, TValue>(ref TContainer, PropertyPath)
Gets the value of the property with the given path for the given container.
Declaration
public static TValue GetValueAtPath<TContainer, TValue>(ref TContainer container, PropertyPath propertyPath)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
PropertyPath | propertyPath | The property path to get. |
Returns
Type | Description |
---|---|
TValue | The value of the property converted to the given type. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
SetCountAtPath<TContainer>(ref TContainer, PropertyPath, Int32, ref ChangeTracker)
Sets the count of the collection property with the given path for the given container.
Declaration
public static void SetCountAtPath<TContainer>(ref TContainer container, PropertyPath propertyPath, int count, ref ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set the count. |
Int32 | count | The new count. |
ChangeTracker | changeTracker | The change tracker to increment if the value changes. |
Type Parameters
Name | Description |
---|---|
TContainer |
SetCountAtPath<TContainer>(ref TContainer, PropertyPath, Int32, IVersionStorage)
Sets the count of the collection property with the given path for the given container.
Declaration
public static void SetCountAtPath<TContainer>(ref TContainer container, PropertyPath propertyPath, int count, IVersionStorage versionStorage = null)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set the count. |
Int32 | count | The new count. |
IVersionStorage | versionStorage | The version storage to increment if the value is changed. |
Type Parameters
Name | Description |
---|---|
TContainer |
SetValue<TContainer, TValue>(ref TContainer, String, TValue, ref ChangeTracker)
Sets the value of the property with the given name for the given container.
Declaration
public static void SetValue<TContainer, TValue>(ref TContainer container, string name, TValue value, ref ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
String | name | The property name to set. |
TValue | value | The value to assign to the property. |
ChangeTracker | changeTracker | The change tracker to increment if the value changes. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
SetValue<TContainer, TValue>(ref TContainer, String, TValue, IVersionStorage)
Sets the value of the property with the given name for the given container.
Declaration
public static void SetValue<TContainer, TValue>(ref TContainer container, string name, TValue value, IVersionStorage versionStorage = null)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
String | name | The property name to set. |
TValue | value | The value to assign to the property. |
IVersionStorage | versionStorage | The version storage to increment if the value is changed. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
SetValueAtPath<TContainer, TValue>(ref TContainer, PropertyPath, TValue, ref ChangeTracker)
Sets the value of the property with the given path for the given container.
Declaration
public static void SetValueAtPath<TContainer, TValue>(ref TContainer container, PropertyPath propertyPath, TValue value, ref ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set. |
TValue | value | The value to assign at the property path. |
ChangeTracker | changeTracker | The change tracker to increment if the value changes. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
SetValueAtPath<TContainer, TValue>(ref TContainer, PropertyPath, TValue, IVersionStorage)
Sets the value of the property with the given path for the given container.
Declaration
public static void SetValueAtPath<TContainer, TValue>(ref TContainer container, PropertyPath propertyPath, TValue value, IVersionStorage versionStorage = null)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set. |
TValue | value | The value to assign at the property path. |
IVersionStorage | versionStorage | The version storage to increment if the value is changed. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
Transfer<TDstContainer, TSrcContainer>(TDstContainer, TSrcContainer)
Declaration
public static VisitResult Transfer<TDstContainer, TSrcContainer>(TDstContainer destination, TSrcContainer source)
where TDstContainer : class
Parameters
Type | Name | Description |
---|---|---|
TDstContainer | destination | |
TSrcContainer | source |
Returns
Type | Description |
---|---|
VisitResult |
Type Parameters
Name | Description |
---|---|
TDstContainer | |
TSrcContainer |
Transfer<TDstContainer, TSrcContainer>(ref TDstContainer, ref TSrcContainer)
Declaration
public static VisitResult Transfer<TDstContainer, TSrcContainer>(ref TDstContainer dstContainer, ref TSrcContainer srcContainer)
Parameters
Type | Name | Description |
---|---|---|
TDstContainer | dstContainer | |
TSrcContainer | srcContainer |
Returns
Type | Description |
---|---|
VisitResult |
Type Parameters
Name | Description |
---|---|
TDstContainer | |
TSrcContainer |
Transfer<TDstContainer, TSrcContainer>(ref TDstContainer, ref TSrcContainer, ref ChangeTracker)
Declaration
public static VisitResult Transfer<TDstContainer, TSrcContainer>(ref TDstContainer dstContainer, ref TSrcContainer srcContainer, ref ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
TDstContainer | dstContainer | |
TSrcContainer | srcContainer | |
ChangeTracker | changeTracker |
Returns
Type | Description |
---|---|
VisitResult |
Type Parameters
Name | Description |
---|---|
TDstContainer | |
TSrcContainer |
Transfer<TDstContainer, TSrcContainer>(ref TDstContainer, ref TSrcContainer, IVersionStorage)
Declaration
public static VisitResult Transfer<TDstContainer, TSrcContainer>(ref TDstContainer dstContainer, ref TSrcContainer srcContainer, IVersionStorage versionStorage)
Parameters
Type | Name | Description |
---|---|---|
TDstContainer | dstContainer | |
TSrcContainer | srcContainer | |
IVersionStorage | versionStorage |
Returns
Type | Description |
---|---|
VisitResult |
Type Parameters
Name | Description |
---|---|
TDstContainer | |
TSrcContainer |
TryGetCountAtPath<TContainer>(ref TContainer, PropertyPath, out Int32)
Gets the count of the collection property with the given path for the given container.
Declaration
public static bool TryGetCountAtPath<TContainer>(ref TContainer container, PropertyPath propertyPath, out int count)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
PropertyPath | propertyPath | The property path to get the count from. |
Int32 | count | The collection count |
Returns
Type | Description |
---|---|
Boolean | The collection count. |
Type Parameters
Name | Description |
---|---|
TContainer |
TryGetValue<TContainer, TValue>(ref TContainer, String, out TValue)
Gets the value of the property with the given name for the given container.
Declaration
public static bool TryGetValue<TContainer, TValue>(ref TContainer container, string name, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
String | name | The property name to get. |
TValue | value | Contains the value if the property is found and the type can be converted; otherwise this is set to default. |
Returns
Type | Description |
---|---|
Boolean | True if the property was found and the value was converted. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
TryGetValueAtPath<TContainer, TValue>(ref TContainer, PropertyPath, out TValue)
Tries to get the value of the property with the given path for the given container.
Declaration
public static bool TryGetValueAtPath<TContainer, TValue>(ref TContainer container, PropertyPath propertyPath, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
PropertyPath | propertyPath | The property path to get. |
TValue | value | The value of the property converted to the given type. |
Returns
Type | Description |
---|---|
Boolean | The value of the property converted to the given type. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
TrySetCountAtPath<TContainer>(ref TContainer, PropertyPath, Int32, ref ChangeTracker)
Sets the count of the collection property with the given path for the given container.
Declaration
public static bool TrySetCountAtPath<TContainer>(ref TContainer container, PropertyPath propertyPath, int count, ref ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set the count. |
Int32 | count | The new count. |
ChangeTracker | changeTracker | The change tracker to increment if the value changes. |
Returns
Type | Description |
---|---|
Boolean |
Type Parameters
Name | Description |
---|---|
TContainer |
TrySetCountAtPath<TContainer>(ref TContainer, PropertyPath, Int32, IVersionStorage)
Sets the count of the collection property with the given path for the given container.
Declaration
public static bool TrySetCountAtPath<TContainer>(ref TContainer container, PropertyPath propertyPath, int count, IVersionStorage versionStorage = null)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set the count. |
Int32 | count | The new count. |
IVersionStorage | versionStorage | The version storage to increment if the value is changed. |
Returns
Type | Description |
---|---|
Boolean |
Type Parameters
Name | Description |
---|---|
TContainer |
TrySetValue<TContainer, TValue>(ref TContainer, String, TValue, ref ChangeTracker)
Sets the value of the property with the given name for the given container.
Declaration
public static bool TrySetValue<TContainer, TValue>(ref TContainer container, string name, TValue value, ref ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
String | name | The property name to set. |
TValue | value | The value to assign to the property. |
ChangeTracker | changeTracker | The change tracker to increment if the value changes. |
Returns
Type | Description |
---|---|
Boolean | True if the property was found and the value was set. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
TrySetValue<TContainer, TValue>(ref TContainer, String, TValue, IVersionStorage)
Sets the value of the property with the given name for the given container.
Declaration
public static bool TrySetValue<TContainer, TValue>(ref TContainer container, string name, TValue value, IVersionStorage versionStorage = null)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container hosting the data. |
String | name | The property name to set. |
TValue | value | The value to assign to the property. |
IVersionStorage | versionStorage | The version storage to increment if the value is changed. |
Returns
Type | Description |
---|---|
Boolean | True if the property was found and the value was set. |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
TrySetValueAtPath<TContainer, TValue>(ref TContainer, PropertyPath, TValue, ref ChangeTracker)
Tries to set the value of the property with the given path for the given container.
Declaration
public static bool TrySetValueAtPath<TContainer, TValue>(ref TContainer container, PropertyPath propertyPath, TValue value, ref ChangeTracker changeTracker)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set. |
TValue | value | The value to assign at the property path. |
ChangeTracker | changeTracker | The change tracker to increment if the value changes. |
Returns
Type | Description |
---|---|
Boolean |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
TrySetValueAtPath<TContainer, TValue>(ref TContainer, PropertyPath, TValue, IVersionStorage)
Tries to set the value of the property with the given path for the given container.
Declaration
public static bool TrySetValueAtPath<TContainer, TValue>(ref TContainer container, PropertyPath propertyPath, TValue value, IVersionStorage versionStorage = null)
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | The container whose data will be set. |
PropertyPath | propertyPath | The property path to set. |
TValue | value | The value to assign at the property path. |
IVersionStorage | versionStorage | The version storage to increment if the value is changed. |
Returns
Type | Description |
---|---|
Boolean |
Type Parameters
Name | Description |
---|---|
TContainer | |
TValue |
TryVisitAtPath<TContainer, TVisitor>(ref TContainer, PropertyPath, TVisitor, ref ChangeTracker)
Declaration
public static bool TryVisitAtPath<TContainer, TVisitor>(ref TContainer container, PropertyPath path, TVisitor visitor, ref ChangeTracker changeTracker)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
PropertyPath | path | |
TVisitor | visitor | |
ChangeTracker | changeTracker |
Returns
Type | Description |
---|---|
Boolean |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |
Visit<TContainer, TVisitor>(TContainer, TVisitor, IVersionStorage)
Declaration
public static void Visit<TContainer, TVisitor>(TContainer container, TVisitor visitor, IVersionStorage versionStorage = null)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
TVisitor | visitor | |
IVersionStorage | versionStorage |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |
Visit<TContainer, TVisitor>(TContainer, ref TVisitor, IVersionStorage)
Declaration
public static void Visit<TContainer, TVisitor>(TContainer container, ref TVisitor visitor, IVersionStorage versionStorage = null)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
TVisitor | visitor | |
IVersionStorage | versionStorage |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |
Visit<TContainer, TVisitor>(ref TContainer, TVisitor, ref ChangeTracker)
Declaration
public static void Visit<TContainer, TVisitor>(ref TContainer container, TVisitor visitor, ref ChangeTracker changeTracker)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
TVisitor | visitor | |
ChangeTracker | changeTracker |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |
Visit<TContainer, TVisitor>(ref TContainer, TVisitor, IVersionStorage)
Declaration
public static void Visit<TContainer, TVisitor>(ref TContainer container, TVisitor visitor, IVersionStorage versionStorage = null)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
TVisitor | visitor | |
IVersionStorage | versionStorage |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |
Visit<TContainer, TVisitor>(ref TContainer, ref TVisitor, ref ChangeTracker)
Declaration
public static void Visit<TContainer, TVisitor>(ref TContainer container, ref TVisitor visitor, ref ChangeTracker changeTracker)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
TVisitor | visitor | |
ChangeTracker | changeTracker |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |
Visit<TContainer, TVisitor>(ref TContainer, ref TVisitor, IVersionStorage)
Declaration
public static void Visit<TContainer, TVisitor>(ref TContainer container, ref TVisitor visitor, IVersionStorage versionStorage = null)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
TVisitor | visitor | |
IVersionStorage | versionStorage |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |
VisitAtPath<TContainer, TVisitor>(ref TContainer, PropertyPath, TVisitor, ref ChangeTracker)
Declaration
public static void VisitAtPath<TContainer, TVisitor>(ref TContainer container, PropertyPath path, TVisitor visitor, ref ChangeTracker changeTracker)
where TVisitor : IPropertyVisitor
Parameters
Type | Name | Description |
---|---|---|
TContainer | container | |
PropertyPath | path | |
TVisitor | visitor | |
ChangeTracker | changeTracker |
Type Parameters
Name | Description |
---|---|
TContainer | |
TVisitor |