Interface IResourceDataAccessorAsync
Namespace: SdlSdl.LanguagePlatformCoreResources
Assembly: Sdl.LanguagePlatform.Core.dll
Syntax
public interface IResourceDataAccessorAsync
Methods
GetResourceDataAsync(CultureCode, LanguageResourceType, bool)
Similar to ReadResourceDataAsync(CultureCode, LanguageResourceType, bool) but returns the result as a byte array.
Declaration
Task<byte[]> GetResourceDataAsync(CultureCode culture, LanguageResourceType t, bool fallback)
Parameters
Type | Name | Description |
---|---|---|
CultureCode | culture | |
LanguageResourceType | t | |
bool | fallback |
Returns
Type | Description |
---|---|
Taskbyte |
GetResourceStatusAsync(CultureCode, LanguageResourceType, bool)
Returns the resource status for the specified resource and the specified culture.
Declaration
Task<ResourceStatus> GetResourceStatusAsync(CultureCode culture, LanguageResourceType t, bool fallback)
Parameters
Type | Name | Description |
---|---|---|
CultureCode | culture | The culture for which the status is requested. |
LanguageResourceType | t | The language resource type which is requested. |
bool | fallback | If true, a resource accessor may fallback to a more general culture. If false, no fallback may be performed. |
Returns
Type | Description |
---|---|
TaskResourceStatus | The resource status for the resource type and culture. |
GetSupportedCultures(LanguageResourceType)
Returns all cultures for which resources are found for the provided resource type.
Declaration
List<CultureCode> GetSupportedCultures(LanguageResourceType t)
Parameters
Type | Name | Description |
---|---|---|
LanguageResourceType | t | The resource type |
Returns
Type | Description |
---|---|
ListCultureCode | The list of cultures for which a resource of the specified type is available |
ReadResourceDataAsync(CultureCode, LanguageResourceType, bool)
Returns the data stream for the specified resource type and culture. If an appropriate resource is not found, an exception is thrown and/or null is returned. Callers should check for both conditions, and check the resource status before the stream is requested.
Declaration
Task<Stream> ReadResourceDataAsync(CultureCode culture, LanguageResourceType t, bool fallback)
Parameters
Type | Name | Description |
---|---|---|
CultureCode | culture | The culture for which a resource is requested. |
LanguageResourceType | t | The language resource type which is requested. |
bool | fallback | If true, a resource accessor may fallback to a more general culture. If false, no fallback may be performed. |
Returns
Type | Description |
---|---|
TaskStream | A stream containing the data for the requested resource, or null if the resource is not available (in which case callers may also throw an exception). |