Language
Edit

DataSourceJson Class

Definition

A data source that can parse a JSON text stream and notify any data consumers listening for changes.

This data source has on Unity specific dependencies.

TODO: refactor this to use DataSourceObjects. Should be a fairly straight refactor since DataSourceObjects was derived from this source code. See DataNodeJson

TODO: Add support for SetValue() and ability to report changes to a back-end services for persisting those changes. This would then allow for data entry slates.

public class DataSourceJson : MixedReality.Toolkit.Data.DataSourceBase
type DataSourceJson = class
    inherit DataSourceBase
Public Class DataSourceJson
Inherits DataSourceBase
Inheritance
DataSourceJson

Constructors

Name Description
DataSourceJson()

Fields

Name Description
_arrayTokenRegex
_dataConsumerKeyPathCounts (Inherited from DataSourceBase)
_dataKeyPathMapper (Inherited from DataSourceBase)
_findArrayIndexRegex (Inherited from DataSourceBase)
_keyPathToDataConsumers (Inherited from DataSourceBase)
_keyPathToJTokenLookup
_keyTokenRegex

Properties

Name Description
DataController (Inherited from DataSourceBase)
DataSourceType

Get the data source type

(Inherited from DataSourceBase)

Methods

Name Description
AddDataConsumerListener(String, IDataConsumer)

Add a new data consumer listener for the specified key path

(Inherited from DataSourceBase)
DataChangeSetBegin()

Begin a data change set.

(Inherited from DataSourceBase)
DataChangeSetBeginForKeyPath(String) (Inherited from DataSourceBase)
DataChangeSetEnd()

End a data change set.

(Inherited from DataSourceBase)
DataChangeSetEndForKeyPath(String) (Inherited from DataSourceBase)
GetCollectionCount(String)

If a key path represents a collection, return the number of items in that collection.

GetCollectionKeyPathRange(String, Int32, Int32)

Get an enumerable collection of key path strings for the specified collection index range.

GetDeindexedKeyPath(String)

Get a path where all array indices have been removed.

(Inherited from DataSourceBase)
GetNthCollectionKeyPathAt(String, Int32)

If a key path represents a collection, return a collection key path for the entry at index n.

GetValue(String)

Get the value associated with the specified key path and prefix

(Inherited from DataSourceBase)
GetValueAsArrayKeyPaths(JToken, String, Int32, Int32)
GetValueAsDictionaryKeyPaths(JToken, String)
GetValueInternal(String)

Get the value from the data source based on its keypath.

IsCollectionAtKeyPath(String)

Determine if key path represents a data collection

IsDataAvailable()

Is data available in the data source.

KeyPathToNode(String)
NotifyAllChanged(DataChangeType, IDataConsumer)

Notify all listeners that data has changed.

(Inherited from DataSourceBase)
NotifyDataChanged(String, Object, DataChangeType, Boolean)

Inform data source that its data has changed.

(Inherited from DataSourceBase)
NotifyListeners()
OnCollectionListenerAdded(String, Object)

Triggered whenever a datum is added that is a collection

(Inherited from DataSourceBase)
OnCollectionListenerRemoved(String)

Triggered whenever a datum is removed that is a collection.

(Inherited from DataSourceBase)
RemoveDataConsumerListener(String, IDataConsumer)

Remove a data consumer listener for the specified key path

(Inherited from DataSourceBase)
ResolveKeyPath(String, String)

Resolve a key path using a given prefix and local path.

(Inherited from DataSourceBase)
SetDataKeyPathMapper(IDataKeyPathMapper)

Set a key path mapper.

(Inherited from DataSourceBase)
SetValue(String, Object, Boolean)

Set the value associated with the specified key path

(Inherited from DataSourceBase)
SetValueInternal(String, Object)

Set the value in the data source based on its keypath.

(Inherited from DataSourceBase)
UpdateFromJson(String)

Applies to