Class SetValueCommand<T>
An undo command that uses a delegates for getting and setting values from a backing model.
Namespace: NanoByte.Common.Undo
Assembly: NanoByte.Common.dll
Syntax
public class SetValueCommand<T> : SimpleCommand, IValueCommand, IUndoCommand
Type Parameters
Name | Description |
---|---|
T | The type of the value to set. |
Constructors
SetValueCommand(PropertyPointer<T>, T)
An undo command that uses a delegates for getting and setting values from a backing model.
Declaration
public SetValueCommand(PropertyPointer<T> pointer, T newValue)
Parameters
Type | Name | Description |
---|---|---|
PropertyPointer<T> | pointer | The object controlling how to read/write the value to be modified. |
T | newValue | The new value to be set. |
Properties
Value
Declaration
public object Value { get; }
Property Value
Type | Description |
---|---|
Object |
Methods
OnExecute()
Sets the new value in the model.
Declaration
protected override void OnExecute()
Overrides
OnUndo()
Restores the old value in the model.
Declaration
protected override void OnUndo()