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
TThe 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
listIList<T>The collection to be modified.
oldElementTThe element to be removed from
list.newElementTThe 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()