Table of Contents

Class ReplaceInList<T>

Namespace
NanoByte.Common.Undo
Assembly
NanoByte.Common.dll

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
object
ReplaceInList<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 T

The element to be removed from list.

newElement T

The 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()