Class Box<T>
public sealed class Box<T> : IOwnedValue<T>, IValue<T>, INotifyValueChanged, IProperty, IOwned, IHasChanges
Type Parameters
T
- Inheritance
-
Box<T>
- Implements
-
IOwnedValue<T>IValue<T>
- Inherited Members
- Extension Methods
Constructors
Box(T)
public Box(T initialValue)
Parameters
initialValueT
Properties
HasValue
Indicates whether the underlying value of type T has a value
public bool HasValue { get; }
Property Value
IsDefaulted
true if the data is a system default rather than user-entered
public bool IsDefaulted { get; set; }
Property Value
Metadata
Owner's property descriptor (if any owner).
public PropertyInfo? Metadata { get; }
Property Value
Parent
Owner (if any).
public EntityKernel? Parent { get; }
Property Value
Value
read/write underlying data
public T Value { get; set; }
Property Value
- T
Methods
GetText()
A textual representation of the underlying value, rather than the IValue itself.
public string GetText()
Returns
HasChanges()
true if the current value differs from its original
public bool HasChanges()
Returns
MarkUnchanged()
update original data so that it's no longer considered changed
public void MarkUnchanged()
NeedsSave()
true if the value has non-derived changes, ones made deliberately by a user or business logic
public bool NeedsSave()
Returns
SetDefaulted()
clear any user-entered data and return to system defaults
public void SetDefaulted()
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Events
ValueChanged
public event EventHandler? ValueChanged