Show / Hide Table of Contents

Class ObservableObject

Base or inner class for observable objects.

Inheritance
System.Object
ObservableObject
Implements
IReactiveObject
IAtomProvider
Namespace: Cortex.Net.Types
Assembly: Cortex.Net.dll
Syntax
public sealed class ObservableObject : object, IReactiveObject, IAtomProvider

Constructors

| Improve this Doc View Source

ObservableObject(String, IEnhancer, ISharedState, IDictionary<String, IValue>)

Initializes a new instance of the ObservableObject class.

Declaration
public ObservableObject(string name, IEnhancer defaultEnhancer, ISharedState sharedState, IDictionary<string, IValue> values = null)
Parameters
Type Name Description
System.String name

The name of the objservable ovject.

IEnhancer defaultEnhancer

The default enhancer to use for newly created values.

ISharedState sharedState

The shared state for this ObservableObject.

IDictionary<System.String, IValue> values

A dictionary with values.

Properties

| Improve this Doc View Source

Name

Gets the name of this ObservableObject.

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SharedState

Gets the Shared State on this object.

Declaration
public ISharedState SharedState { get; }
Property Value
Type Description
ISharedState

Methods

| Improve this Doc View Source

AddComputedMember<T>(String, ComputedValueOptions<T>)

Adds a Computed Value.

Declaration
public void AddComputedMember<T>(string key, ComputedValueOptions<T> computedValueOptions)
Parameters
Type Name Description
System.String key

The key of the member.

ComputedValueOptions<T> computedValueOptions

The computed value options.

Type Parameters
Name Description
T

The return type of the member.

| Improve this Doc View Source

AddObservableProperty<T>(String, T, IEnhancer)

Adds an Observable property to this ObservableObject instnace.

Declaration
public void AddObservableProperty<T>(string propertyName, T initialValue = null, IEnhancer enhancer = null)
Parameters
Type Name Description
System.String propertyName

The name of the property.

T initialValue

The initial value.

IEnhancer enhancer

The enhancer to use.

Type Parameters
Name Description
T

The type of the property.

| Improve this Doc View Source

Has(String)

Returns whether this ObservableObject instance has a property of method with the name key.

Declaration
public bool Has(string key)
Parameters
Type Name Description
System.String key

The key to check.

Returns
Type Description
System.Boolean

True when this object contains the key, false otherwise.

| Improve this Doc View Source

Read<T>(String)

Gets the value for property or method with specified key.

Declaration
public T Read<T>(string key)
Parameters
Type Name Description
System.String key

The key.

Returns
Type Description
T

The value.

Type Parameters
Name Description
T

The type of the value.

| Improve this Doc View Source

Remove(String)

Removes a property or computed value.

Declaration
public void Remove(string key)
Parameters
Type Name Description
System.String key

The key to remove.

| Improve this Doc View Source

Write<T>(String, T)

Sets the value for property or method with the specified value.

Declaration
public void Write<T>(string key, T value)
Parameters
Type Name Description
System.String key

The key.

T value

The value.

Type Parameters
Name Description
T

The type of the value.

Events

| Improve this Doc View Source

Change

Event that fires before a value on the object will change.

Declaration
public event EventHandler<ObjectCancellableEventArgs> Change
Event Type
Type Description
EventHandler<ObjectCancellableEventArgs>
| Improve this Doc View Source

Changed

Event that fires after a value on the object has changed.

Declaration
public event EventHandler<ObjectEventArgs> Changed
Event Type
Type Description
EventHandler<ObjectEventArgs>

Explicit Interface Implementations

| Improve this Doc View Source

IAtomProvider.Atom

Gets the atom.

Declaration
IAtom IAtomProvider.Atom { get; }
Returns
Type Description
IAtom

Implements

IReactiveObject
IAtomProvider

Extension Methods

TraceExtensions.Trace<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>, TraceMode)
ReactiveObjectTypeUtilExtensions.GetObservable(Object)
ReactiveObjectTypeUtilExtensions.GetObservable<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX