Class SharedVariable<T>
public abstract class SharedVariable<T> : SharedVariable, ICloneable, IDisposable, IVariable<T>
Type Parameters
T
- Inheritance
-
SharedVariable<T>
- Implements
-
IVariable<T>
- Derived
- Inherited Members
- Extension Methods
Constructors
SharedVariable()
protected SharedVariable()
Fields
Getter
protected Func<T> Getter
Field Value
- Func<T>
Setter
protected Action<T> Setter
Field Value
- Action<T>
value
protected T value
Field Value
- T
Properties
Value
public T Value { get; set; }
Property Value
- T
Methods
Bind(IVariable<T>)
public void Bind(IVariable<T> other)
Parameters
otherIVariable<T>
Bind(SharedVariable)
Bind to other sharedVariable
public override void Bind(SharedVariable other)
Parameters
otherSharedVariable
Clone()
Clone shared variable by deep copy, an option here is to override for preventing using reflection
public override sealed SharedVariable Clone()
Returns
CloneT()
protected virtual SharedVariable<T> CloneT()
Returns
CopyProperty(SharedVariable)
protected void CopyProperty(SharedVariable other)
Parameters
otherSharedVariable
Dispose()
Unbind self
public override void Dispose()
GetValue()
public override sealed object GetValue()
Returns
GetValueType()
public override Type GetValueType()
Returns
Observe()
Create a observe proxy variable
public override ObserveProxyVariable Observe()
Returns
ObserveT()
public ObserveProxyVariable<T> ObserveT()
Returns
SetValue(object)
public override sealed void SetValue(object newValue)
Parameters
newValueobject