Class PropertyChangedCommand
An undo command that handles a changed property - usually used with a PropertyGrid.
Implements
Inherited Members
Namespace: NanoByte.Common.Undo
Assembly: NanoByte.Common.WinForms.dll
Syntax
public class PropertyChangedCommand : PreExecutedCommand, IUndoCommand
Constructors
PropertyChangedCommand(Object, PropertyDescriptor, Object, Object)
An undo command that handles a changed property - usually used with a PropertyGrid.
Declaration
public PropertyChangedCommand(object target, PropertyDescriptor property, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
Object | target | The object the property belongs to. |
PropertyDescriptor | property | The property that was changed. |
Object | oldValue | The property's old value. |
Object | newValue | The property's current value. |
PropertyChangedCommand(Object, PropertyValueChangedEventArgs)
Initializes the command after the property was first changed.
Declaration
public PropertyChangedCommand(object target, PropertyValueChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Object | target | The object the SelectedObject is target at. |
PropertyValueChangedEventArgs | e | The event data from the PropertyValueChanged. |
Methods
OnRedo()
Set the changed property value again.
Declaration
protected override void OnRedo()
Overrides
OnUndo()
Restore the original property value.
Declaration
protected override void OnUndo()