Class EmbeddedResourceAttribute
Attribute that declares an embedded resource to load.
Indicates that the named resource should be loaded into the decorated field or property when the class instance is passed to LoadResources(Object).
LoadResources(Object)Inherited Members
Namespace: Firefly.EmbeddedResourceLoader
Assembly: Firefly.EmbeddedResourceLoader.dll
Syntax
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public sealed class EmbeddedResourceAttribute : Attribute
Constructors
| Improve this Doc View SourceEmbeddedResourceAttribute(String)
Initializes a new instance of the EmbeddedResourceAttribute class.
Declaration
public EmbeddedResourceAttribute(string resourcePath)
Parameters
| Type | Name | Description |
|---|---|---|
| String | resourcePath | The resource path. |
Remarks
Resource is assumed to be contained within the assembly containing the declaration of the decorated class.
You don't need to give the complete path including the whole namespace, only enough to make the requested resource unambiguous from any other similarly named resource in the assembly.
EmbeddedResourceAttribute(String, Assembly)
Initializes a new instance of the EmbeddedResourceAttribute class.
Declaration
public EmbeddedResourceAttribute(string resourcePath, Assembly containingAssembly)
Parameters
| Type | Name | Description |
|---|---|---|
| String | resourcePath | The resource path. |
| Assembly | containingAssembly | The assembly that contains the resource. |
Remarks
You don't need to give the complete path including the whole namespace, only enough to make the requested resource unambiguous from any other similarly named resource in the assembly.
EmbeddedResourceAttribute(String, String)
Initializes a new instance of the EmbeddedResourceAttribute class.
Declaration
public EmbeddedResourceAttribute(string resourcePath, string assemblyFullyQualifiedName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | resourcePath | The resource path. |
| String | assemblyFullyQualifiedName | Fully qualified name of assembly to load resource from. |
Remarks
You don't need to give the complete path including the whole namespace, only enough to make the requested resource unambiguous from any other similarly named resource in the assembly.
Properties
| Improve this Doc View SourceContainingAssembly
Gets the containing assembly, that is, the assembly that is expected to contain the embedded resource.
Declaration
public Assembly ContainingAssembly { get; }
Property Value
| Type | Description |
|---|---|
| Assembly | The containing assembly. If |
DirectoryRenames
Gets or sets directory renames for the TempDirectory resource. When embedding resources, the compiler changes all hyphens in directory names to underscores which means the materialized directory structure is incorrect
Due to the fact that attribute constructors can only accept simple types, this property must be a string array rather than the more suitable Dictionary<TKey,TValue>
Declaration
public string[] DirectoryRenames { get; set; }
Property Value
| Type | Description |
|---|---|
| String[] | Must be an array with an even number of elements, where every pair of elements specifies a name and a new name for the preceding element. |
PreserveFileExtension
Gets or sets file extension preservation for the TempFile resource.
If set, then the extension of the fi,e in the resource manifest is preserved; else the file gets a .tmp extension.
Declaration
public bool PreserveFileExtension { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
ResourcePath
Gets the resource path.
Declaration
public string ResourcePath { get; }
Property Value
| Type | Description |
|---|---|
| String | The resource path. |