Table of Contents

Class MemberCloneContext

Namespace
AsmResolver.DotNet.Cloning
Assembly
AsmResolver.DotNet.dll

Provides a working space for a member cloning procedure.

public class MemberCloneContext
Inheritance
MemberCloneContext
Inherited Members

Constructors

MemberCloneContext(ModuleDefinition)

Creates a new instance of the MemberCloneContext class.

public MemberCloneContext(ModuleDefinition module)

Parameters

module ModuleDefinition

The target module to copy the cloned members into.

MemberCloneContext(ModuleDefinition, Func<MemberCloneContext, CloneContextAwareReferenceImporter>?)

Creates a new instance of the MemberCloneContext class.

public MemberCloneContext(ModuleDefinition module, Func<MemberCloneContext, CloneContextAwareReferenceImporter>? importerFactory)

Parameters

module ModuleDefinition

The target module to copy the cloned members into.

importerFactory Func<MemberCloneContext, CloneContextAwareReferenceImporter>

The factory for creating the reference importer

Properties

ClonedMembers

Gets a mapping of original members to cloned members.

public IDictionary<IMemberDescriptor, IMemberDescriptor> ClonedMembers { get; }

Property Value

IDictionary<IMemberDescriptor, IMemberDescriptor>

ClonedTypes

Gets a mapping of original types to their cloned counterparts.

public IDictionary<ITypeDescriptor, ITypeDescriptor> ClonedTypes { get; }

Property Value

IDictionary<ITypeDescriptor, ITypeDescriptor>

Remarks

This dictionary performs lookups based on value using a SignatureComparer instead of object identity, and can thus be used to translate type references to included type definitions.

Importer

Gets the object responsible for importing references into the target module.

public CloneContextAwareReferenceImporter Importer { get; }

Property Value

CloneContextAwareReferenceImporter

Module

Gets the target module to copy the cloned members into.

public ModuleDefinition Module { get; }

Property Value

ModuleDefinition