Table of Contents

Class SetInList<T>

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

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

The old element currently in the list to be replaced.

newElement T

The new element to take the place of oldElement in the list.

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