Show / Hide Table of Contents

Interface IIconStore

Stores icon files downloaded from the web as local files.

Namespace: ZeroInstall.Store.Icons
Assembly: ZeroInstall.Store.dll
Syntax
public interface IIconStore
Remarks

Implementations of this interface are immutable and thread-safe.

Methods

Get(Icon, out Boolean)

Gets an icon from the cache or downloads it if not yet cached.

Declaration
string Get(Icon icon, out bool shouldRefresh)
Parameters
Type Name Description
Icon icon

The icon to get.

Boolean shouldRefresh

Indicates whether the returned file is outdated and EffectiveNetworkUse is Full.

Returns
Type Description
String

The file path of the icon in the cache.

Exceptions
Type Condition
OperationCanceledException

The user canceled the task.

IOException

A problem occurred while adding the icon to the cache.

UnauthorizedAccessException

Read or write access to the cache is not permitted.

WebException

A problem occurred while downloading the icon.

InvalidDataException

The icon does not have a valid format.

GetCached(Icon, out Boolean)

Tries to get an icon that is already cached.

Declaration
string GetCached(Icon icon, out bool shouldRefresh)
Parameters
Type Name Description
Icon icon

The icon to get.

Boolean shouldRefresh

Indicates whether the returned file is outdated and EffectiveNetworkUse is Full.

Returns
Type Description
String

The file path of the icon in the cache; null if the icon is not cached yet.

GetFresh(Icon)

Gets an icon from the cache or downloads it if not yet cached or outdated.

Declaration
string GetFresh(Icon icon)
Parameters
Type Name Description
Icon icon

The icon to get.

Returns
Type Description
String

The file path of the icon in the cache.

Exceptions
Type Condition
OperationCanceledException

The user canceled the task.

IOException

A problem occurred while adding the icon to the cache.

UnauthorizedAccessException

Read or write access to the cache is not permitted.

WebException

A problem occurred while downloading the icon.

InvalidDataException

The icon does not have a valid format.

Extension Methods

IconStoreExtensions.GetCached(IIconStore, Icon)
In This Article
Back to top Copyright Bastian Eicher et al