Skip to main content

DeviceResources

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid (4.1.0.0)

Provides methods for accessing resources embedded within the Hybrid client application.

public class DeviceResources

Access this class through the Device singleton.

Methods​

Instance member GetBytes(resource)​

Gets a byte array of the given resource if it exists.

ParameterTypeDescription
resourceStringThe name of the resource or relative path from the project root.

Returns: Byte[]. The resource byte array.

A HybridAsset: /Assets/image.png can be accessed using "image.png" if only one HybridAsset named "image.png" exists or "/Assets/image.png".

Instance member GetBytesAsync(resource)​

Gets a byte array of the given resource if it exists.

ParameterTypeDescription
resourceStringThe name of the resource or relative path from the project root.

Returns: Task<Byte[]>. The resource byte array.

A HybridAsset: /Assets/image.png can be accessed using "image.png" if only one HybridAsset named "image.png" exists or "/Assets/image.png".

Instance member GetStream(resource)​

Gets a stream of the given resource if it exists.

ParameterTypeDescription
resourceStringThe name of the resource or relative path from the project root.

Returns: MemoryStream. The resource stream.

Instance member GetStreamAsync(resource)​

Gets a stream of the given resource if it exists.

ParameterTypeDescription
resourceStringThe name of the resource or relative path from the project root.

Returns: Task<MemoryStream>. The resource stream.