Class ModelDataCache
Model data cache
Inherited Members
Namespace: Pixiv.VroidSdk.Cache
Assembly: Pixiv.VroidSdk.dll
Syntax
public sealed class ModelDataCache
Constructors
ModelDataCache(IDownloadLicensePublishable, IFileReadWriteDelete, ICacheStorage<CachedDownloadLicenseFile>, ICacheMigrator<CachedDownloadLicenseFile>)
Constructor
Declaration
public ModelDataCache(IDownloadLicensePublishable modelDownloadableApi, IFileReadWriteDelete cryptoFileReadWrite, ICacheStorage<CachedDownloadLicenseFile> storage, ICacheMigrator<CachedDownloadLicenseFile> migrator = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IDownloadLicensePublishable | modelDownloadableApi | API that can issue download licenses |
| IFileReadWriteDelete | cryptoFileReadWrite | Module to encrypt and save files, decrypt and load files |
| ICacheStorage<CachedDownloadLicenseFile> | storage | ICacheStorage<TValue> that manages cache |
| ICacheMigrator<CachedDownloadLicenseFile> | migrator | Cache migrator |
Methods
Fetch(CharacterModel, Action<Byte[]>, Action<Single>, Action<ApiErrorFormat>)
Get character model from network.
If cache exists character model will be retrieved from cache data.
Declaration
public void Fetch(CharacterModel characterModel, Action<byte[]> onSuccess, Action<float> onProgress, Action<ApiErrorFormat> onFailed)
Parameters
| Type | Name | Description |
|---|---|---|
| CharacterModel | characterModel | Target model |
| Action<Byte[]> | onSuccess | Callback on success |
| Action<Single> | onProgress | Callback during API request |
| Action<ApiErrorFormat> | onFailed | Callback on failure |
FetchAsync(CharacterModel, Action<Single>)
Declaration
public async Task<byte[]> FetchAsync(CharacterModel characterModel, Action<float> onProgress = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CharacterModel | characterModel | |
| Action<Single> | onProgress |
Returns
| Type | Description |
|---|---|
| Task<Byte[]> |