Class ContentLibraryHandler
Handler in charge of taking care of the content library features and utilities.
Inherited Members
Namespace: Appearition.ContentLibrary
Assembly: Appearition.SDK.dll
Syntax
public class ContentLibraryHandler : BaseHandler
Methods
View SourceClearLocalAssetContentProcess<T>(String, T, String, Action<Boolean>)
Clears the cached content of an asset based on given parameters.
Declaration
public static IEnumerator ClearLocalAssetContentProcess<T>(string providerName, T file, string itemKey = null, Action<bool> onComplete = null)
where T : ContentFile
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | |
T | file | |
System.String | itemKey | Item key, mainly used to pick the file storage location. Can be the item Title. |
System.Action<System.Boolean> | onComplete | Occurs when the process is completed. Contains whether or not this process has been successfully completed. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Type Parameters
Name | Description |
---|---|
T |
DownloadFirstLibraryFileFoundProcess(Int32, String, String, String, Action<Dictionary<String, Byte[]>>, DataTransferStatus)
From a given provider name and item key, fetches the first file that can be downloaded.
Declaration
public static IEnumerator DownloadFirstLibraryFileFoundProcess(int channelId, string providerName, string contentItemKey, string itemKey, Action<Dictionary<string, byte[]>> onComplete = null, DataTransferStatus downloadTransferStatus = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | channelId | The target channel |
System.String | providerName | The provider name |
System.String | contentItemKey | The content library item key |
System.String | itemKey | Item key, mainly used to pick the file storage location. Can be the item Title. |
System.Action<System.Collections.Generic.Dictionary<System.String, System.Byte[]>> | onComplete | Occurs when the process is completed. Contains whether or not this process has been successfully completed. |
DataTransferStatus | downloadTransferStatus | The transfer process tracker. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
DownloadFirstLibraryFileFoundProcess(String, String, String, Action<Dictionary<String, Byte[]>>, DataTransferStatus)
From a given provider name and item key, fetches the first file that can be downloaded.
Declaration
public static IEnumerator DownloadFirstLibraryFileFoundProcess(string providerName, string contentItemKey, string itemKey, Action<Dictionary<string, byte[]>> onComplete = null, DataTransferStatus downloadTransferStatus = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | The provider name |
System.String | contentItemKey | The content library item key |
System.String | itemKey | Item key, mainly used to pick the file storage location. Can be the item Title. |
System.Action<System.Collections.Generic.Dictionary<System.String, System.Byte[]>> | onComplete | Occurs when the process is completed. Contains whether or not this process has been successfully completed. |
DataTransferStatus | downloadTransferStatus | The transfer process tracker. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
DownloadLibraryFileContent<T>(String, T, String, Action<Byte[]>, DataTransferStatus)
Downloads a single content library file, stores it, and returns the byte content.
Declaration
public static IEnumerator DownloadLibraryFileContent<T>(string providerName, T file, string itemKey, Action<byte[]> onComplete = null, DataTransferStatus downloadTransferStatus = null)
where T : ContentFile
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | The content provider name. |
T | file | The given content library file. |
System.String | itemKey | Item key, mainly used to pick the file storage location. Can be the item Title. |
System.Action<System.Byte[]> | onComplete | Occurs when the process is completed. Contains whether or not this process has been successfully completed. |
DataTransferStatus | downloadTransferStatus | The transfer process tracker. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Type Parameters
Name | Description |
---|---|
T |
DownloadLibraryFileThumbnail<T>(String, T, String, Boolean, Action<Sprite>, DataTransferStatus)
Downloads a single content library file, stores it, and returns the byte content.
Declaration
public static IEnumerator DownloadLibraryFileThumbnail<T>(string providerName, T file, string itemKey, bool loadThumbnail = true, Action<Sprite> onComplete = null, DataTransferStatus downloadTransferStatus = null)
where T : ContentThumbnail
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | The content provider name. |
T | file | The given content library file. |
System.String | itemKey | Item key, mainly used to pick the file storage location. Can be the item Title. |
System.Boolean | loadThumbnail | |
System.Action<UnityEngine.Sprite> | onComplete | Occurs when the process is completed. Contains whether or not this process has been successfully completed. |
DataTransferStatus | downloadTransferStatus | The transfer process tracker. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Type Parameters
Name | Description |
---|---|
T |
GetContentItemProcess(Int32, String, String, Boolean, Boolean, String, Action<ContentItem>, Action<EmsError>, Action<Boolean>, DataTransferStatus)
Declaration
public static IEnumerator GetContentItemProcess(int channelId, string providerName, string contentItemKey, bool downloadThumbnail, bool downloadContentFiles, string customFileKey = "", Action<ContentItem> onSuccess = null, Action<EmsError> onFailure = null, Action<bool> onComplete = null, DataTransferStatus downloadTransferStatus = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | channelId | |
System.String | providerName | |
System.String | contentItemKey | |
System.Boolean | downloadThumbnail | |
System.Boolean | downloadContentFiles | |
System.String | customFileKey | |
System.Action<ContentItem> | onSuccess | |
System.Action<EmsError> | onFailure | |
System.Action<System.Boolean> | onComplete | |
DataTransferStatus | downloadTransferStatus |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
GetContentItemProcess(String, String, Boolean, Boolean, String, Action<ContentItem>, Action<EmsError>, Action<Boolean>, DataTransferStatus)
Declaration
public static IEnumerator GetContentItemProcess(string providerName, string contentItemKey, bool downloadThumbnail, bool downloadContentFiles, string customFileKey = "", Action<ContentItem> onSuccess = null, Action<EmsError> onFailure = null, Action<bool> onComplete = null, DataTransferStatus downloadTransferStatus = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | |
System.String | contentItemKey | |
System.Boolean | downloadThumbnail | |
System.Boolean | downloadContentFiles | |
System.String | customFileKey | |
System.Action<ContentItem> | onSuccess | |
System.Action<EmsError> | onFailure | |
System.Action<System.Boolean> | onComplete | |
DataTransferStatus | downloadTransferStatus |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
GetPathToContentFile(String, ContentFile, String)
Path to a Content library file.
Declaration
public static string GetPathToContentFile(string providerName, ContentFile file, string fileKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | |
ContentFile | file | |
System.String | fileKey |
Returns
Type | Description |
---|---|
System.String |
GetPathToContentFileDirectory(String, String)
Path to the directory holding Content library file.
Declaration
public static string GetPathToContentFileDirectory(string providerName, string fileKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | |
System.String | fileKey |
Returns
Type | Description |
---|---|
System.String |
GetPathToContentProviderDirectory(String)
Path to the directory holding Content library provider.
Declaration
public static string GetPathToContentProviderDirectory(string providerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName |
Returns
Type | Description |
---|---|
System.String |
GetPathToContentThumbnail(String, ContentFile, String)
Path to a Content library file.
Declaration
public static string GetPathToContentThumbnail(string providerName, ContentFile thumbnail, string fileKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | |
ContentFile | thumbnail | |
System.String | fileKey |
Returns
Type | Description |
---|---|
System.String |
GetPathToContentThumbnailDirectory(String, String)
Path to the directory holding Content library thumbnail.
Declaration
public static string GetPathToContentThumbnailDirectory(string providerName, string fileKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | |
System.String | fileKey |
Returns
Type | Description |
---|---|
System.String |
TryToFindFirstItemWithContentKey(String, String)
Tries to find the first file with stored under a given fileKey.
Declaration
public static string TryToFindFirstItemWithContentKey(string providerName, string fileKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | |
System.String | fileKey |
Returns
Type | Description |
---|---|
System.String |