Show / Hide Table of Contents

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)
Inheritance
Object
Attribute
EmbeddedResourceAttribute
Inherited Members
Attribute.Equals(Object)
Attribute.GetCustomAttribute(Assembly, Type)
Attribute.GetCustomAttribute(Assembly, Type, Boolean)
Attribute.GetCustomAttribute(MemberInfo, Type)
Attribute.GetCustomAttribute(MemberInfo, Type, Boolean)
Attribute.GetCustomAttribute(Module, Type)
Attribute.GetCustomAttribute(Module, Type, Boolean)
Attribute.GetCustomAttribute(ParameterInfo, Type)
Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean)
Attribute.GetCustomAttributes(Assembly)
Attribute.GetCustomAttributes(Assembly, Boolean)
Attribute.GetCustomAttributes(Assembly, Type)
Attribute.GetCustomAttributes(Assembly, Type, Boolean)
Attribute.GetCustomAttributes(MemberInfo)
Attribute.GetCustomAttributes(MemberInfo, Boolean)
Attribute.GetCustomAttributes(MemberInfo, Type)
Attribute.GetCustomAttributes(MemberInfo, Type, Boolean)
Attribute.GetCustomAttributes(Module)
Attribute.GetCustomAttributes(Module, Boolean)
Attribute.GetCustomAttributes(Module, Type)
Attribute.GetCustomAttributes(Module, Type, Boolean)
Attribute.GetCustomAttributes(ParameterInfo)
Attribute.GetCustomAttributes(ParameterInfo, Boolean)
Attribute.GetCustomAttributes(ParameterInfo, Type)
Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean)
Attribute.GetHashCode()
Attribute.IsDefaultAttribute()
Attribute.IsDefined(Assembly, Type)
Attribute.IsDefined(Assembly, Type, Boolean)
Attribute.IsDefined(MemberInfo, Type)
Attribute.IsDefined(MemberInfo, Type, Boolean)
Attribute.IsDefined(Module, Type)
Attribute.IsDefined(Module, Type, Boolean)
Attribute.IsDefined(ParameterInfo, Type)
Attribute.IsDefined(ParameterInfo, Type, Boolean)
Attribute.Match(Object)
Attribute.TypeId
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Firefly.EmbeddedResourceLoader
Assembly: Firefly.EmbeddedResourceLoader.dll
Syntax
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public sealed class EmbeddedResourceAttribute : Attribute

Constructors

| Improve this Doc View Source

EmbeddedResourceAttribute(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

ContainingAssembly

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 null then resource is assumed to be contained within the assembly containing the declaration of the decorated class.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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

true to preserve file extension] otherwise, false.

| Improve this Doc View Source

ResourcePath

Gets the resource path.

Declaration
public string ResourcePath { get; }
Property Value
Type Description
String

The resource path.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX