Table of Contents

Class SetValueCommand<T>

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

An undo command that uses a delegates for getting and setting values from a backing model.

public class SetValueCommand<T> : SimpleCommand, IValueCommand, IUndoCommand

Type Parameters

T

The type of the value to set.

Inheritance
SetValueCommand<T>
Implements
Inherited Members
Extension Methods

Constructors

SetValueCommand(PropertyPointer<T>, T)

An undo command that uses a delegates for getting and setting values from a backing model.

public SetValueCommand(PropertyPointer<T> pointer, T newValue)

Parameters

pointer PropertyPointer<T>

The object controlling how to read/write the value to be modified.

newValue T

The new value to be set.

Properties

Value

public object? Value { get; }

Property Value

object

Methods

OnExecute()

Sets the new value in the model.

protected override void OnExecute()

OnUndo()

Restores the old value in the model.

protected override void OnUndo()