PixelCrushers.DataSynchronizer Class Reference

Uses the MessageSystem to keep data synchronized between a source and a listener. More...

Inheritance diagram for PixelCrushers.DataSynchronizer:
Collaboration diagram for PixelCrushers.DataSynchronizer:

Public Member Functions

void OnMessage (MessageArgs messageArgs)
 Handles messages requesting to change the value of the data source.
 
void DataSourceValueChanged (object newValue)
 When the data source has changed its value, it should call this method to inform listeners.
 

Static Public Attributes

const string DataSourceValueChangedMessage = "Data Source Value Changed"
 Message that data source sends to inform listeners that the value changed.
 
const string RequestDataSourceChangeValueMessage = "Request Data Source Change Value"
 Message that listeners send to request this data synchronizer to change the data source's value.
 

Protected Member Functions

virtual void OnEnable ()
 
virtual void OnDisable ()
 

Properties

string dataSourceName [get, set]
 A name to associate with the data source.
 
ObjectUnityEvent onRequestDataSourceChangeValue [get, set]
 Event to send to data source to request it to change value.
 

Detailed Description

Uses the MessageSystem to keep data synchronized between a source and a listener.

Member Function Documentation

◆ DataSourceValueChanged()

void PixelCrushers.DataSynchronizer.DataSourceValueChanged ( object  newValue)
inline

When the data source has changed its value, it should call this method to inform listeners.

Parameters
newValueThe data source's new value.

◆ OnDisable()

virtual void PixelCrushers.DataSynchronizer.OnDisable ( )
inlineprotectedvirtual

◆ OnEnable()

virtual void PixelCrushers.DataSynchronizer.OnEnable ( )
inlineprotectedvirtual

◆ OnMessage()

void PixelCrushers.DataSynchronizer.OnMessage ( MessageArgs  messageArgs)
inline

Handles messages requesting to change the value of the data source.

On receipt of the RequestDataSourceChangeValueMessage, invokes the onRequestDataSourceChangeValue event, passing the first argument of the message as the new value.

Parameters
messageArgsFirst argument is the new value.

Implements PixelCrushers.IMessageHandler.

Member Data Documentation

◆ DataSourceValueChangedMessage

const string PixelCrushers.DataSynchronizer.DataSourceValueChangedMessage = "Data Source Value Changed"
static

Message that data source sends to inform listeners that the value changed.

◆ RequestDataSourceChangeValueMessage

const string PixelCrushers.DataSynchronizer.RequestDataSourceChangeValueMessage = "Request Data Source Change Value"
static

Message that listeners send to request this data synchronizer to change the data source's value.

Property Documentation

◆ dataSourceName

string PixelCrushers.DataSynchronizer.dataSourceName
getset

A name to associate with the data source.

Data change messages that reference this name will invoke the value update events.

◆ onRequestDataSourceChangeValue

ObjectUnityEvent PixelCrushers.DataSynchronizer.onRequestDataSourceChangeValue
getset

Event to send to data source to request it to change value.


The documentation for this class was generated from the following file: