TSUI.Data
Extends: None
Exported: Yes

Associated source files:

Description

Defines the structure for data accessors. Data accessors push or pull data to/from a data source such as a page on a web server.
T: Specifies the type of the data which will be sent to/from the server.

Public Properties

BaseAccessInfo: Data.IAccessInfo;
The normal access info to use in PushData and PullData when no alternative info is supplied. Use this to set up a data accessor for repeated access to the same data source.
OnDataPulled: TSUI.Events.DataPulledEvent<T>;
Fired when data is pulled from the server (or when the data pull request fails).
Check the Status property of the event.
OnDataPushed: TSUI.Events.DataPushedEvent<T>;
Fired when data is pushed to the server (or when the data push request fails).
Check the Status property of the event.


Public Methods

PullData(): Data.IDataAccessResult<T>
Pulls data from the data source (using the BaseAccessInfo property for data source).Note: This should be an aynschronous method.
  • Returns: TSUI.Data.IDataAccessResult<T> - The status of the request. Implementations of this which are asynchronous should return empty result with status Pending.
PullData(accessInfo?: Data.IAccessInfo): Data.IDataAccessResult<T>
Pulls data from the data source using the specified AccessInfo for the data source.Note: This should be an aynschronous method.
  • OPTIONAL accessInfo: Data.IAccessInfo - The AccessInfo to use for the data source.
  • Returns: TSUI.Data.IDataAccessResult<T> - The status of the request. Implementations of this which are asynchronous should return empty result with status Pending.
PushData(data: T): Data.IDataAccessResult<T>
Pushes data to the data source (using the BaseAccessInfo property for data source).Note: This should be an aynschronous method.
  • data: T - The data to push to the server.
  • Returns: TSUI.Data.IDataAccessResult<T> - The status of the request. Implementations of this which are asynchronous should return an empty result with status Pending.
PushData(data: T, accessInfo?: Data.IAccessInfo): Data.IDataAccessResult<T>
Pushes data to the data source using the specified AccessInfo for the data source.Note: This should be an aynschronous method.
  • data: T - The data to push to the server.
  • OPTIONAL accessInfo: Data.IAccessInfo - The AccessInfo to use for the data source.
  • Returns: TSUI.Data.IDataAccessResult<T> - The result of the request. Implementations of this which are asynchronous should return an empty result with status Pending.


Last edited Aug 29, 2013 at 8:53 PM by EdwardNutting, version 1

Comments

No comments yet.