NanoByte.Common
Public Member Functions | Protected Member Functions | List of all members
NanoByte.Common.Undo.PropertyChangedCommand Class Reference

An undo command that handles a changed property - usually used with a PropertyGrid. More...

Inheritance diagram for NanoByte.Common.Undo.PropertyChangedCommand:
NanoByte.Common.Undo.PreExecutedCommand NanoByte.Common.Undo.FirstExecuteCommand NanoByte.Common.Undo.IUndoCommand

Public Member Functions

 PropertyChangedCommand (object target, PropertyDescriptor property, object oldValue, object newValue)
 Initializes the command after the property was first changed. More...
 
 PropertyChangedCommand (object target, PropertyValueChangedEventArgs e)
 Initializes the command after the property was first changed. More...
 
- Public Member Functions inherited from NanoByte.Common.Undo.FirstExecuteCommand
void Execute ()
 Performs the desired action. More...
 
virtual void Undo ()
 Undoes the changes made by Execute. More...
 

Protected Member Functions

override void OnRedo ()
 Set the changed property value again. More...
 
override void OnUndo ()
 Restore the original property value. More...
 
- Protected Member Functions inherited from NanoByte.Common.Undo.PreExecutedCommand
sealed override void OnFirstExecute ()
 Do nothing on first execute. More...
 

Detailed Description

An undo command that handles a changed property - usually used with a PropertyGrid.

Constructor & Destructor Documentation

◆ PropertyChangedCommand() [1/2]

NanoByte.Common.Undo.PropertyChangedCommand.PropertyChangedCommand ( object  target,
PropertyDescriptor  property,
object  oldValue,
object  newValue 
)
inline

Initializes the command after the property was first changed.

Parameters
targetThe object the property belongs to.
propertyThe property that was changed.
oldValueThe property's old value.
newValueThe property's current value.

◆ PropertyChangedCommand() [2/2]

NanoByte.Common.Undo.PropertyChangedCommand.PropertyChangedCommand ( object  target,
PropertyValueChangedEventArgs  e 
)
inline

Initializes the command after the property was first changed.

Parameters
targetThe object the PropertyGrid.SelectedObject is target at.
eThe event data from the PropertyGrid.PropertyValueChanged.

Member Function Documentation

◆ OnRedo()

override void NanoByte.Common.Undo.PropertyChangedCommand.OnRedo ( )
protectedvirtual

Set the changed property value again.

Implements NanoByte.Common.Undo.FirstExecuteCommand.

◆ OnUndo()

override void NanoByte.Common.Undo.PropertyChangedCommand.OnUndo ( )
protectedvirtual

Restore the original property value.

Implements NanoByte.Common.Undo.FirstExecuteCommand.


The documentation for this class was generated from the following file: