Show / Hide Table of Contents

Class SetValueCommand

Factory methods for SetValueCommand<T>.

Inheritance
Object
SetValueCommand
Namespace: NanoByte.Common.Undo
Assembly: NanoByte.Common.dll
Syntax
public static class SetValueCommand : Object

Methods

For<T>(PropertyPointer<T>, T)

Creates a new value-setting command.

Declaration
public static SetValueCommand<T> For<T>(PropertyPointer<T> pointer, T newValue)
Parameters
Type Name Description
PropertyPointer<T> pointer

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

T newValue

The new value to be set.

Returns
Type Description
SetValueCommand<T>
Type Parameters
Name Description
T

The type of the value to set.

For<T>(Func<T>, Action<T>, T)

Creates a new value-setting command.

Declaration
public static SetValueCommand<T> For<T>(Func<T> getValue, Action<T> setValue, T newValue)
Parameters
Type Name Description
Func<T> getValue

A delegate that returns the current value.

Action<T> setValue

A delegate that sets the value.

T newValue

The new value to be set.

Returns
Type Description
SetValueCommand<T>
Type Parameters
Name Description
T

The type of the value to set.

For<T>(Expression<Func<T>>, T)

Creates a new value-setting command.

Declaration
public static SetValueCommand<T> For<T>(Expression<Func<T>> expression, T newValue)
Parameters
Type Name Description
Expression<Func<T>> expression

An expression pointing to the property.

T newValue

The new value to be set.

Returns
Type Description
SetValueCommand<T>
Type Parameters
Name Description
T

The type of value the property contains.

In This Article
Back to top Copyright Bastian Eicher