API ReferenceSandbox.Resources
ResourceCompilerclass
Takes the "source" of a resource and creates a compiled version. The compiled version can create a number of child resources and store binary data.
object→ResourceCompiler
Constructors1
Showing 1 constructors
protected ResourceCompiler()
No results match this filter.
Methods6
Showing 6 methods
protected virtual System.Threading.Tasks.Task`1<bool> Compile()
Returns:
Task<bool>—protected virtual bool CompileEmbedded(Sandbox.Resources.EmbeddedResource json)
| Parameter | Type | Description |
|---|---|---|
| json | EmbeddedResource | — |
Returns:
bool—protected bool CompileEmbeddedResource(Sandbox.Resources.EmbeddedResource embed, string subfolder, string extension, Sandbox.BaseFileSystem fs)
Generic method to compile an embedded resource by creating a child context. This handles the common pattern of creating a generator, generating a path, creating a child context, and setting the compiled path.
| Parameter | Type | Description |
|---|---|---|
| embed | EmbeddedResource | — |
| subfolder | string | — |
| extension | string | — |
| fs | BaseFileSystem | — |
Returns:
bool—protected string CreateGeneratedResourcePath(Sandbox.Resources.EmbeddedResource embed, string subfolder, string extension)
Create a deterministic path for a generated resource based on the embedded resource data.
| Parameter | Type | Description |
|---|---|---|
| embed | EmbeddedResource | — |
| subfolder | string | — |
| extension | string | — |
Returns:
string—protected bool TryParseEmbeddedResource(System.Nullable`1<Sandbox.Resources.EmbeddedResource> resource)
| Parameter | Type | Description |
|---|---|---|
| resource | Nullable<EmbeddedResource> | — |
Returns:
bool—protected System.Threading.Tasks.Task`1<bool> WriteToJson()
Writes resource to a JSON file, using the ResourceGenerator to create the resource.
Returns:
Task<bool>—No results match this filter.
Properties1
Showing 1 properties
public Sandbox.Resources.ResourceCompileContext Sandbox.Resources.ResourceCompiler.Context { get; set; }
No results match this filter.