Table of Contents

Class ResourceConfiguration<TResource>

Namespace
Bonsai.Resources
Assembly
Bonsai.System.dll

Provides the abstract base class for configuring and loading specific resources.

public abstract class ResourceConfiguration<TResource> : IResourceConfiguration where TResource : IDisposable

Type Parameters

TResource

The type of the resource.

Inheritance
ResourceConfiguration<TResource>
Implements
Derived
Inherited Members

Properties

Name

Gets or sets the name of the resource.

public string Name { get; set; }

Property Value

string

Methods

CreateResource(ResourceManager)

When overridden in a derived class, creates a new resource of type TResource.

public abstract TResource CreateResource(ResourceManager resourceManager)

Parameters

resourceManager ResourceManager

The ResourceManager object onto which this resource will be loaded. The resource manager can be accessed to load additional resource dependencies which may be required to create the new resource.

Returns

TResource

A new instance of type TResource.

OpenResource(string)

Opens a stream for reading the specified resource.

protected Stream OpenResource(string path)

Parameters

path string

The name of the resource to be opened for reading.

Returns

Stream

A Stream object for reading the resource.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.