Table of Contents

Class FontCache<T>

Namespace
Xui.Core.Canvas
Assembly
Xui.Core.dll

Fixed-capacity, allocation-free-after-construction LRU cache keyed by Font.

public class FontCache<T>

Type Parameters

T

The cached value associated with a resolved font.

Inheritance
FontCache<T>
Derived
Inherited Members

Constructors

FontCache(int)

Initializes a cache with the requested number of entries.

public FontCache(int capacity = 64)

Parameters

capacity int

Fields

DefaultCapacity

The standard number of font entries retained by a context cache.

public const int DefaultCapacity = 64

Field Value

int

Properties

EntryCapacity

Gets the number of retained font entries.

public int EntryCapacity { get; }

Property Value

int

Methods

Clear()

Clears every retained entry.

public void Clear()

OnEvicted(T)

Releases a value when its entry is replaced, evicted, or cleared.

protected virtual void OnEvicted(T value)

Parameters

value T

Set(in Font, T)

Adds or refreshes the value for font.

public void Set(in Font font, T value)

Parameters

font Font
value T

TryGet(in Font, out T)

Gets the cached value for font when available.

public bool TryGet(in Font font, out T value)

Parameters

font Font
value T

Returns

bool