Class SetInList<T>
Replaces an entry in a IList<T> with a new one.
Namespace: NanoByte.Common.Undo
Assembly: NanoByte.Common.dll
Syntax
public sealed class SetInList<T> : SimpleCommand, IValueCommand, IUndoCommand
Type Parameters
Name | Description |
---|---|
T | The type of elements the list contains. |
Constructors
SetInList(IList<T>, T, T)
Replaces an entry in a IList<T> with a new one.
Declaration
public SetInList(IList<T> list, T oldElement, T newElement)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | The list to be modified. |
T | oldElement | The old element currently in the |
T | newElement | The new element to take the place of |
Properties
Value
Declaration
public object Value { get; }
Property Value
Type | Description |
---|---|
Object |
Methods
OnExecute()
Sets the new entry in the list.
Declaration
protected override void OnExecute()
Overrides
OnUndo()
Restores the old entry in the list.
Declaration
protected override void OnUndo()