Class ResourceUtilities
Used for loading resources from an assembly, and other related actions
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class ResourceUtilities
Methods
| Edit this page View SourceHasResource(string, Assembly)
Checks if the assembly has the specified resource path
Declaration
public static bool HasResource(string resourcePath, Assembly assembly = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourcePath | The path to check if it exists |
| Assembly | assembly | The assembly to check in |
Returns
| Type | Description |
|---|---|
| bool | Returns whether the specified resource path exists in the assembly |
LoadAssembly(string, Assembly)
Loads an assembly from a resource path in an existing assembly
Declaration
public static Assembly LoadAssembly(string resourcePath, Assembly assembly = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourcePath | The path of the assembly resource |
| Assembly | assembly | The assembly to load the resource from |
Returns
| Type | Description |
|---|---|
| Assembly | Returns the loaded assembly |
Retrieve(string, Assembly)
Retrieves a stream of data from the resource path in the assembly
Declaration
public static Stream Retrieve(string resourcePath, Assembly assembly = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourcePath | The path of the resource to load |
| Assembly | assembly | The assembly to load from |
Returns
| Type | Description |
|---|---|
| Stream | Returns a stream containing the data of the resource |