Class SetInList<T>
Replaces an entry in a System.Collections.Generic.IList<T> with a new one.
public sealed class SetInList<T> : SimpleCommand, IValueCommand, IUndoCommand where T : notnull
Type Parameters
T
The type of elements the list contains.
- Inheritance
-
objectSetInList<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
SetInList(IList<T>, T, T)
Replaces an entry in a System.Collections.Generic.IList<T> with a new one.
public SetInList(IList<T> list, T oldElement, T newElement)
Parameters
list
IList<T>The list to be modified.
oldElement
TThe old element currently in the
list
to be replaced.newElement
TThe new element to take the place of
oldElement
in thelist
.
Properties
Value
public object Value { get; }
Property Value
- object
Methods
OnExecute()
Sets the new entry in the list.
protected override void OnExecute()
OnUndo()
Restores the old entry in the list.
protected override void OnUndo()