Table of Contents

Class Lens<T>

Namespace
The.Values
Assembly
Instagile.dll
public sealed class Lens<T> : IOwnedValue<T>, IValue<T>, INotifyValueChanged, IProperty, IOwned, IHasChanges

Type Parameters

T
Inheritance
Lens<T>
Implements
Inherited Members
Extension Methods

Constructors

Lens(Func<T>, Action<T>, Func<bool>?, Action?, Func<bool>?, Action?, Func<bool>?, Func<bool>?)

public Lens(Func<T> get, Action<T> set, Func<bool>? hasChanges = null, Action? markUnchanged = null, Func<bool>? isDefaulted = null, Action? setDefaulted = null, Func<bool>? needsSave = null, Func<bool>? hasValue = null)

Parameters

get Func<T>
set Action<T>
hasChanges Func<bool>
markUnchanged Action
isDefaulted Func<bool>
setDefaulted Action
needsSave Func<bool>
hasValue Func<bool>

Properties

HasValue

Indicates whether the underlying value of type T has a value

public bool HasValue { get; }

Property Value

bool

IsDefaulted

true if the data is a system default rather than user-entered

public bool IsDefaulted { get; }

Property Value

bool

IsPresent

public bool IsPresent { get; }

Property Value

bool

Metadata

Owner's property descriptor (if any owner).

public PropertyInfo? Metadata { get; }

Property Value

PropertyInfo

Parent

Owner (if any).

public EntityKernel? Parent { get; }

Property Value

EntityKernel

Value

read/write underlying data

public T Value { get; set; }

Property Value

T

Methods

GetText()

A textual representation of the underlying value, rather than the IValue itself.

public string GetText()

Returns

string

HasChanges()

true if the current value differs from its original

public bool HasChanges()

Returns

bool

MarkUnchanged()

update original data so that it's no longer considered changed

public void MarkUnchanged()

NeedsSave()

true if the value has non-derived changes, ones made deliberately by a user or business logic

public bool NeedsSave()

Returns

bool

RaiseValueChanged()

public void RaiseValueChanged()

SetDefaulted()

clear any user-entered data and return to system defaults

public void SetDefaulted()

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Events

ValueChanged

public event EventHandler? ValueChanged

Event Type

EventHandler