NanoByte.Common
2.6.1
|
An undo command that replaces an element in a list with a new one. More...
Public Member Functions | |
ReplaceInList (IList< T > list, T oldElement, T newElement) | |
Creates a new replace in list command. More... | |
![]() | |
void | Execute () |
Performs the desired action. More... | |
virtual void | Undo () |
Undoes the changes made by Execute. More... | |
Static Public Member Functions | |
static ReplaceInList< T > | For< T > (IList< T > list, T oldElement, T newElement) |
Creates a new replace in list command. More... | |
Protected Member Functions | |
override void | OnExecute () |
Template method to perform the desired action. More... | |
override void | OnUndo () |
Template method to undo the changes made by OnExecute. More... | |
Properties | |
object | Value [get] |
![]() | |
object? | Value [get] |
An undo command that replaces an element in a list with a new one.
Factory methods for ReplaceInList<T>.
T | The type of elements the list contains. |
T | : | notnull |
|
inline |
Creates a new replace in list command.
list | The collection to be modified. |
oldElement | The element to be removed from list . |
newElement | The element to be added to list . |
|
static |
Creates a new replace in list command.
list | The collection to be modified. |
oldElement | The element to be removed from list . |
newElement | The element to be added to list . |
T | The type of elements the list contains. |
T | : | notnull | |
T | : | new | |
T | : | list | |
T | : | oldElement | |
T | : | newElement |
|
protectedvirtual |
Template method to perform the desired action.
Implements NanoByte.Common.Undo.SimpleCommand.
|
protectedvirtual |
Template method to undo the changes made by OnExecute.
Implements NanoByte.Common.Undo.SimpleCommand.