C# Class Sharpen.Html.Expression

Represents the base class for all expressions. Expressions represent a value, and optionally a value that can change after being read (in which case, it provides a mechanism to subscribe for changes)
ファイルを表示 Open project: nikhilk/sharpen Class Usage Examples

Public Methods

Method Description
Expression ( object value, bool canChange ) : System

Initializes and instance of an Expression.

GetValue ( ) : object

Gets the current value of the expression.

SetValue ( object value ) : void

Sets the value of the expression. Most expressions are read-only and ignore this call, but some expressions do support the ability to write back.

Subscribe ( System.Action changeCallback ) : void

Allows a consumer of the expression to subscribe to change notifications.

Protected Methods

Method Description
UpdateValue ( object value, bool notify ) : void

Updates the value represented by the expression.

Method Details

Expression() public method

Initializes and instance of an Expression.
public Expression ( object value, bool canChange ) : System
value object The initial value of the expression.
canChange bool Whether the expression represents a value that can change.
return System

GetValue() public method

Gets the current value of the expression.
public GetValue ( ) : object
return object

SetValue() public method

Sets the value of the expression. Most expressions are read-only and ignore this call, but some expressions do support the ability to write back.
public SetValue ( object value ) : void
value object The new value of the expression.
return void

Subscribe() public method

Allows a consumer of the expression to subscribe to change notifications.
public Subscribe ( System.Action changeCallback ) : void
changeCallback System.Action The callback to be invoked.
return void

UpdateValue() protected method

Updates the value represented by the expression.
protected UpdateValue ( object value, bool notify ) : void
value object The new value of the expression.
notify bool Whether to notify the subscriber of the change.
return void