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

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

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

Public Member Functions

 MultiPropertyChangedCommand ([NotNull] object[] targets, [NotNull] PropertyDescriptor property, [NotNull] object[] oldValues, object newValue)
 Initializes the command after the properties were first changed. More...
 
 MultiPropertyChangedCommand ([NotNull] object[] targets, [NotNull] GridItem gridItem, [NotNull] object[] oldValues)
 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 values. 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 multiple changed properties - usually used with a PropertyGrid.

See also
MultiPropertyTracker

Constructor & Destructor Documentation

◆ MultiPropertyChangedCommand() [1/2]

NanoByte.Common.Undo.MultiPropertyChangedCommand.MultiPropertyChangedCommand ( [NotNull] object []  targets,
[NotNull] PropertyDescriptor  property,
[NotNull] object []  oldValues,
object  newValue 
)
inline

Initializes the command after the properties were first changed.

Parameters
targetsThe objects the property belongs to.
propertyThe property that was changed.
oldValuesThe property's old values.
newValueThe property's current value.

◆ MultiPropertyChangedCommand() [2/2]

NanoByte.Common.Undo.MultiPropertyChangedCommand.MultiPropertyChangedCommand ( [NotNull] object []  targets,
[NotNull] GridItem  gridItem,
[NotNull] object []  oldValues 
)
inline

Initializes the command after the property was first changed.

Parameters
targetsThe objects the PropertyGrid.SelectedObject is target at.
gridItemThe grid item representing the property being changed.
oldValuesThe property's old values.

Member Function Documentation

◆ OnRedo()

override void NanoByte.Common.Undo.MultiPropertyChangedCommand.OnRedo ( )
inlineprotectedvirtual

Set the changed property value again.

Implements NanoByte.Common.Undo.FirstExecuteCommand.

◆ OnUndo()

override void NanoByte.Common.Undo.MultiPropertyChangedCommand.OnUndo ( )
inlineprotectedvirtual

Restore the original property values.

Implements NanoByte.Common.Undo.FirstExecuteCommand.


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