Class ClrAssembly
A Flame assembly that wraps a Cecil assembly definition.
Inheritance
Inherited Members
Namespace: Flame.Clr
Assembly: Flame.Clr.dll
Syntax
public sealed class ClrAssembly : IAssembly, IMember
Constructors
| Improve this Doc View SourceClrAssembly(AssemblyDefinition, ReferenceResolver)
Creates a Flame assembly that wraps a Cecil assembly definition.
Declaration
public ClrAssembly(AssemblyDefinition definition, ReferenceResolver resolver)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.AssemblyDefinition | definition | The assembly definition to wrap. |
ReferenceResolver | resolver | The reference resolver to use. |
ClrAssembly(AssemblyDefinition, AssemblyResolver, TypeEnvironment)
Creates a Flame assembly that wraps a Cecil assembly definition.
Declaration
public ClrAssembly(AssemblyDefinition definition, AssemblyResolver resolver, TypeEnvironment typeEnvironment)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.AssemblyDefinition | definition | The assembly definition to wrap. |
AssemblyResolver | resolver | The assembly resolver to use. |
TypeEnvironment | typeEnvironment | The type environment to use. |
Properties
| Improve this Doc View SourceAttributes
Gets the member's attributes.
Declaration
public AttributeMap Attributes { get; }
Property Value
Type | Description |
---|---|
AttributeMap |
Definition
Gets the Cecil assembly definition wrapped by this assembly.
Declaration
public AssemblyDefinition Definition { get; }
Property Value
Type | Description |
---|---|
Mono.Cecil.AssemblyDefinition | A Cecil assembly definition. |
FullName
Gets the member's full name.
Declaration
public QualifiedName FullName { get; }
Property Value
Type | Description |
---|---|
QualifiedName |
Name
Gets the member's unqualified name.
Declaration
public UnqualifiedName Name { get; }
Property Value
Type | Description |
---|---|
UnqualifiedName |
Resolver
Gets the reference resolver used by this assembly.
Declaration
public ReferenceResolver Resolver { get; }
Property Value
Type | Description |
---|---|
ReferenceResolver | The reference resolver. |
SyncRoot
Gets the object that is used for synchronizing access to the IL assembly wrapped by this Flame assembly.
Declaration
public object SyncRoot { get; }
Property Value
Type | Description |
---|---|
System.Object | A synchronization object. |
Types
Gets a list of all top-level types defined in this assembly.
Declaration
public IReadOnlyList<IType> Types { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<IType> | A list of types that are defined in this assembly. |
Methods
| Improve this Doc View SourceCreateSynchronizedInitializer(Action)
Creates a deferred initializer object from an initializer function that is run in a single-threaded fashion with respect to other functions operating on this assembly.
Declaration
public DeferredInitializer CreateSynchronizedInitializer(Action func)
Parameters
Type | Name | Description |
---|---|---|
System.Action | func | The initialization function to run synchronously. |
Returns
Type | Description |
---|---|
DeferredInitializer | A deferred initializer object. |
CreateSynchronizedLazy<T>(Func<T>)
Creates a lazily initialized object from an initializer function that is run in a single-threaded fashion with respect to other functions operating on this assembly.
Declaration
public Lazy<T> CreateSynchronizedLazy<T>(Func<T> func)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T> | func | The initialization function to run synchronously. |
Returns
Type | Description |
---|---|
System.Lazy<T> | A lazily initialized object. |
Type Parameters
Name | Description |
---|---|
T | The type of value to create. |
Resolve(AssemblyNameReference)
Resolves an assembly name reference as an assembly.
Declaration
public IAssembly Resolve(AssemblyNameReference assemblyRef)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.AssemblyNameReference | assemblyRef | An assembly name reference to resolve. |
Returns
Type | Description |
---|---|
IAssembly | The assembly referenced by |
Resolve(FieldReference)
Resolves a field reference declared in this assembly.
Declaration
public IField Resolve(FieldReference fieldRef)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.FieldReference | fieldRef | The field reference to resolve. |
Returns
Type | Description |
---|---|
IField | A field referred to by the reference. |
Resolve(MethodReference)
Resolves a method reference declared in this assembly.
Declaration
public IMethod Resolve(MethodReference methodRef)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.MethodReference | methodRef | The method reference to resolve. |
Returns
Type | Description |
---|---|
IMethod | A method referred to by the reference. |
Resolve(PropertyReference)
Resolves a property reference declared in this assembly.
Declaration
public IProperty Resolve(PropertyReference propertyRef)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.PropertyReference | propertyRef | The property reference to resolve. |
Returns
Type | Description |
---|---|
IProperty | A property referred to by the reference. |
Resolve(TypeReference)
Resolves a type reference declared in this assembly.
Declaration
public IType Resolve(TypeReference typeRef)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.TypeReference | typeRef | The type reference to resolve. |
Returns
Type | Description |
---|---|
IType | A type referred to by the reference. |
RunSynchronized(Action)
Runs a function in a single-threaded fashion with respect to other functions operating on this assembly.
Declaration
public void RunSynchronized(Action func)
Parameters
Type | Name | Description |
---|---|---|
System.Action | func | The function to run. |
RunSynchronized<T>(Func<T>)
Runs a function in a single-threaded fashion with respect to other functions operating on this assembly.
Declaration
public T RunSynchronized<T>(Func<T> func)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T> | func | The function to run. |
Returns
Type | Description |
---|---|
T | The function's return value. |
Type Parameters
Name | Description |
---|---|
T | The type of value produced by the function. |
Wrap(AssemblyDefinition)
Wraps a CIL assembly definition in a Flame assembly, setting up an assembly resolver and type system.
Declaration
public static ClrAssembly Wrap(AssemblyDefinition definition)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.AssemblyDefinition | definition | The assembly definition to wrap. |
Returns
Type | Description |
---|---|
ClrAssembly | A Flame assembly. |