Show / Hide Table of Contents

Class ReplaceInList<T>

An undo command that replaces an element in a list with a new one.

Inheritance
Object
SimpleCommand
ReplaceInList<T>
Implements
IValueCommand
IUndoCommand
Inherited Members
SimpleCommand.Execute()
SimpleCommand.Undo()
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)

Creates a new replace in list command.

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 list.

T newElement

The element to be added to list.

Properties

Value

Declaration
public object Value { get; }
Property Value
Type Description
Object

Methods

OnExecute()

Declaration
protected override void OnExecute()
Overrides
SimpleCommand.OnExecute()

OnUndo()

Declaration
protected override void OnUndo()
Overrides
SimpleCommand.OnUndo()

Implements

IValueCommand
IUndoCommand

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher