Class DelegateProperty<TContainer, TValue>
Represents a value property.
Inherited Members
Namespace: Unity.Properties
Syntax
public class DelegateProperty<TContainer, TValue> : Property<TContainer, TValue>, IProperty<TContainer>, IProperty, IPropertyAccept<TContainer>, IAttributes
Type Parameters
| Name | Description |
|---|---|
| TContainer | The container type this property will access data on. |
| TValue | The value type for this property. |
Remarks
A DelegateProperty<TContainer, TValue> is the default way to construct properties.
Constructors
DelegateProperty(String, PropertyGetter<TContainer, TValue>, PropertySetter<TContainer, TValue>)
Initializes a new instance of the DelegateProperty<TContainer, TValue> class.
Declaration
public DelegateProperty(string name, PropertyGetter<TContainer, TValue> getter, PropertySetter<TContainer, TValue> setter = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The property name. |
| PropertyGetter<TContainer, TValue> | getter | The delegate to use when accessing the property value. |
| PropertySetter<TContainer, TValue> | setter | The delegate to use when setting the property value. |
Properties
IsReadOnly
Declaration
public override bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Overrides
Unity.Properties.Property<TContainer, TValue>.IsReadOnly
Name
Declaration
public override string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
Overrides
Unity.Properties.Property<TContainer, TValue>.Name
Methods
GetValue(ref TContainer)
Declaration
public override TValue GetValue(ref TContainer container)
Parameters
| Type | Name | Description |
|---|---|---|
| TContainer | container |
Returns
| Type | Description |
|---|---|
| TValue |
Overrides
Unity.Properties.Property<TContainer, TValue>.GetValue(TContainer)
SetValue(ref TContainer, TValue)
Declaration
public override void SetValue(ref TContainer container, TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| TContainer | container | |
| TValue | value |
Overrides
Unity.Properties.Property<TContainer, TValue>.SetValue(TContainer, TValue)
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The property is read-only. |