Detailed Description

Retrieves a block of binary data for use on the UI. Used by e.g. fonts.

Public Member Functions

 DataPackage (string src, string relativeTo)
 Creates a new package to get the named file. You must then call Get to perform the request. More...
 
void Get (OnDataReady ready)
 Sends the request off and defines a callback to run when the result is ready. More...
 
void GotData (byte[] data)
 Got data is called by the file handler when the response is received. More...
 
void GotData (byte[] data, string error)
 Got data is called by the file handler when the response is received. More...
 

Public Attributes

byte[] Data
 The data that was retrieved. You must check if it is Ok first. More...
 
string Error
 Any error that occured. More...
 
FilePath File
 The file that was requested. More...
 
string FileType
 The type of file that was requested (e.g. "woff" or "ttf") More...
 
object ExtraData
 A custom data object for passing anything else when the callback runs. More...
 

Properties

string Url [get]
 The fully resolved URL requested. More...
 
bool Ok [get]
 True if there is no error and the data is ok. More...
 
bool Errored [get]
 True if there was an error and the data is not ok. More...
 

Events

OnDataReady Ready
 The callback to run when complete. More...
 

Private Member Functions

void SetPath (string src, string relativeTo)
 Sets up the filepath to the given url which may be relative to a given location. More...
 

Constructor & Destructor Documentation

PowerUI.DataPackage.DataPackage ( string  src,
string  relativeTo 
)
inline

Creates a new package to get the named file. You must then call Get to perform the request.

Parameters
srcThe file to get.
relativeToThe path the file to get is relative to, if any (may be null).

Member Function Documentation

void PowerUI.DataPackage.Get ( OnDataReady  ready)
inline

Sends the request off and defines a callback to run when the result is ready.

Parameters
readyThe callback to run. Note that the callback must check if the result is Ok.
void PowerUI.DataPackage.GotData ( byte[]  data)
inline

Got data is called by the file handler when the response is received.

Parameters
dataThe data that was recieved.
void PowerUI.DataPackage.GotData ( byte[]  data,
string  error 
)
inline

Got data is called by the file handler when the response is received.

Parameters
dataThe data that was recieved, if any.
errorAn error that occured, if any.
void PowerUI.DataPackage.SetPath ( string  src,
string  relativeTo 
)
inlineprivate

Sets up the filepath to the given url which may be relative to a given location.

Parameters
srcThe file to get.
relativeToThe path the file to get is relative to, if any. May be null.

Member Data Documentation

byte [] PowerUI.DataPackage.Data

The data that was retrieved. You must check if it is Ok first.

string PowerUI.DataPackage.Error

Any error that occured.

object PowerUI.DataPackage.ExtraData

A custom data object for passing anything else when the callback runs.

FilePath PowerUI.DataPackage.File

The file that was requested.

string PowerUI.DataPackage.FileType

The type of file that was requested (e.g. "woff" or "ttf")

Property Documentation

bool PowerUI.DataPackage.Errored
get

True if there was an error and the data is not ok.

bool PowerUI.DataPackage.Ok
get

True if there is no error and the data is ok.

string PowerUI.DataPackage.Url
get

The fully resolved URL requested.

Event Documentation

OnDataReady PowerUI.DataPackage.Ready

The callback to run when complete.