Class ReplaceInList<T>
An undo command that replaces an element in a list with a new one.
Namespace: NanoByte.Common.Undo
Assembly: NanoByte.Common.dll
Syntax
public class ReplaceInList<T> : SimpleCommand, IValueCommand, IUndoCommand
Type Parameters
Name | Description |
---|---|
T | The type of elements the list contains. |
Constructors
ReplaceInList(IList<T>, T, T)
An undo command that replaces an element in a list with a new one.
Declaration
public ReplaceInList(IList<T> list, T oldElement, T newElement)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | The collection to be modified. |
T | oldElement | The element to be removed from |
T | newElement | The element to be added to |
Properties
Value
Declaration
public object Value { get; }
Property Value
Type | Description |
---|---|
Object |
Methods
OnExecute()
Declaration
protected override void OnExecute()
Overrides
OnUndo()
Declaration
protected override void OnUndo()