template class MAGES::OverridableProperty¶
Overview¶
A class that can hold any data which can be overriden by a user. Make sure to add the DefaultValueLocatorAttribute to the class; right now literal default values are not supported. NOTE: OverridableProperty<T> can only be used in classes that inherit from PropertyCollection. More…
templateclass OverridableProperty: public MAGES::OverridablePropertyBase { public: // properties override object OverridenValue; // methods OverridableProperty(); OverridableProperty(bool isOverridden = false, T value = default); new T GetEffectiveValue(); void Override(T value); void Reset(); };
Inherited Members¶
public: // properties DefaultValueLocatorAttribute.LocatorData LocatorData; bool IsOverridden; abstract object OverridenValue; // methods OverridablePropertyBase(bool isOverridden = false, object value = default); object GetEffectiveValue();
Detailed Documentation¶
A class that can hold any data which can be overriden by a user. Make sure to add the DefaultValueLocatorAttribute to the class; right now literal default values are not supported. NOTE: OverridableProperty<T> can only be used in classes that inherit from PropertyCollection.
Parameters:
T |
The data type. |
Methods¶
OverridableProperty()
Initializes a new instance of the OverridableProperty<T> class.
OverridableProperty(bool isOverridden = false, T value = default)
Initializes a new instance of the OverridableProperty<T> class.
Parameters:
isOverridden |
True if the value overriden. |
value |
the overridden value. |
new T GetEffectiveValue()
Gets the effective value of this property.
Returns:
The overridden value, or the default value, accordingly.
void Override(T value)
Overrides the value of this property.
Parameters:
value |
The override value. |
void Reset()
Resets the value of this property.