s&box docs
API ReferenceSandbox.Resources

public abstract class Sandbox.Resources.ResourceGenerator<T> : Sandbox.Resources.ResourceGenerator

A resource generator targetting a specific type

Constructors

Showing 1 constructors

Methods

Showing 8 methods

public void AddToCache(T val)

public virtual System.Threading.Tasks.ValueTask`1<T> CreateAsync(Sandbox.Resources.ResourceGenerator.Options options, System.Threading.CancellationToken token)

Create the resource asyncronously

public virtual T FindCached()

Find a previously created of this resource

public virtual T FindOrCreate(Sandbox.Resources.ResourceGenerator.Options options)

If we generated this before, then find the current cache'd value. If not, then generate a new one.

public virtual System.Threading.Tasks.ValueTask`1<T> FindOrCreateAsync(Sandbox.Resources.ResourceGenerator.Options options, System.Threading.CancellationToken token)

If we generated this before, then find the current cache'd value. If not, then generate a new one.

public virtual System.Threading.Tasks.ValueTask`1<Sandbox.Resource> FindOrCreateObjectAsync(Sandbox.Resources.ResourceGenerator.Options options, System.Threading.CancellationToken token)

Properties

Showing 1 properties

public virtual bool Sandbox.Resources.ResourceGenerator<T>.UseMemoryCache { get; set; }

If true then the generation will avoid creating duplicate resources by checking hash codes of previously generated resources and re-using them if possible.

Metadata

FieldValue
NamespaceSandbox.Resources
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Resources.ResourceGenerator`1

On this page