NanoByte.Common
2.7.0
|
Replaces an entry in a IList<T> with a new one. More...
Public Member Functions | |
SetInList (IList< T > list, T oldElement, T newElement) | |
Creates a new set 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 SetInList< T > | For< T > (IList< T > list, T oldElement, T newElement) |
Creates a new set in list command. More... | |
Protected Member Functions | |
override void | OnExecute () |
Sets the new entry in the list. More... | |
override void | OnUndo () |
Restores the old entry in the list. More... | |
Properties | |
object | Value [get] |
![]() | |
object? | Value [get] |
Replaces an entry in a IList<T> with a new one.
Factory methods for SetInList<T>.
T | The type of elements the list contains. |
T | : | notnull |
|
inline |
Creates a new set in list command.
list | The list to be modified. |
oldElement | The old element currently in the list to be replaced. |
newElement | The new element to take the place of oldElement in the list . |
|
static |
Creates a new set in list command.
list | The list to be modified. |
oldElement | The old element currently in the list to be replaced. |
newElement | The new element to take the place of oldElement in the list . |
T | The type of elements the list contains. |
T | : | notnull | |
T | : | new | |
T | : | list | |
T | : | oldElement | |
T | : | newElement |
|
protectedvirtual |
Sets the new entry in the list.
Implements NanoByte.Common.Undo.SimpleCommand.
|
protectedvirtual |
Restores the old entry in the list.
Implements NanoByte.Common.Undo.SimpleCommand.