C# Класс MALClient.Shared.Managers.ImageCache

Provides methods and tools to cache images in a temporary local folder
Показать файл Открыть проект

Открытые методы

Метод Описание
ClearAsync ( System.TimeSpan duration = null ) : Task

call this method to clear the entire cache.

GetCacheFileName ( Uri uri ) : string

Gets the local cache file name associated with a specified Uri.

GetFromCacheAsync ( Uri uri ) : Task

Load a specific image from the cache. If the image is not in the cache, ImageCache will try to download and store it.

GetHttpStreamToStorageFileAsync ( this uri, StorageFile targetFile ) : Task

Get the response stream returned by a HTTP get request and save it to a local file.

PerformScheduledCacheCleanup ( ) : void

Приватные методы

Метод Описание
CreateBitmapImage ( string fileName ) : Uri
CreateHash64 ( Uri uri ) : ulong
CreateHash64 ( string str ) : ulong
EnsureFileAsync ( Uri uri ) : Task
GetCacheFolderAsync ( ) : Task
GetHttpContentAsync ( Uri uri ) : Task
ImageCache ( ) : System
IsFileOutOfDate ( StorageFile file, System.DateTime expirationDate ) : Task

Описание методов

ClearAsync() публичный статический Метод

call this method to clear the entire cache.
public static ClearAsync ( System.TimeSpan duration = null ) : Task
duration System.TimeSpan Use this parameter to define a timespan from now to select cache entries to delete.
Результат Task

GetCacheFileName() публичный статический Метод

Gets the local cache file name associated with a specified Uri.
public static GetCacheFileName ( Uri uri ) : string
uri System.Uri Uri of the resource.
Результат string

GetFromCacheAsync() публичный статический Метод

Load a specific image from the cache. If the image is not in the cache, ImageCache will try to download and store it.
public static GetFromCacheAsync ( Uri uri ) : Task
uri System.Uri Uri of the image.
Результат Task

GetHttpStreamToStorageFileAsync() публичный статический Метод

Get the response stream returned by a HTTP get request and save it to a local file.
public static GetHttpStreamToStorageFileAsync ( this uri, StorageFile targetFile ) : Task
uri this Uri to request.
targetFile Windows.Storage.StorageFile StorageFile to save the stream to.
Результат Task

PerformScheduledCacheCleanup() публичный статический Метод

public static PerformScheduledCacheCleanup ( ) : void
Результат void