Class ReplaceInList<T>
An undo command that replaces an element in a list with a new one.
public class ReplaceInList<T> : SimpleCommand, IValueCommand, IUndoCommand where T : notnull
Type Parameters
T
The type of elements the list contains.
- Inheritance
-
objectReplaceInList<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
ReplaceInList(IList<T>, T, T)
An undo command that replaces an element in a list with a new one.
public ReplaceInList(IList<T> list, T oldElement, T newElement)
Parameters
list
IList<T>The collection to be modified.
oldElement
TThe element to be removed from
list
.newElement
TThe element to be added to
list
.
Properties
Value
public object Value { get; }
Property Value
- object
Methods
OnExecute()
Template method to perform the desired action.
protected override void OnExecute()
OnUndo()
Template method to undo the changes made by OnExecute().
protected override void OnUndo()