C# 클래스 Microsoft.Cci.MutableContracts.GenericMethodParameterMapper

If the original method that contained the anonymous delegate is generic, then the code generated by the compiler, the "closure method", is also generic. If the anonymous delegate didn't capture any locals or parameters, then a (generic) static method was generated to implement the lambda. If it did capture things, then the closure method is a non-generic instance method in a generic class. In either case, any references to those generic parameters need to be mapped back to become references to the original method's generic parameters. Create an instance of this class for each anonymous delegate using the appropriate constructor. This is known from whether the closure method is (static and generic) or (instance and not-generic, but whose containing type is generic). Those are the only two patterns created by the compiler.
상속: Microsoft.Cci.MutableCodeModel.Contracts.CodeAndContractRewriter
파일 보기 프로젝트 열기: visualmutator/visualmutator 1 사용 예제들

공개 메소드들

메소드 설명
GenericMethodParameterMapper ( IMetadataHost host, IMethodDefinition targetMethod, IMethodDefinition sourceMethod ) : System

Use this constructor when the anonymous delegate did not capture any locals or parameters and so was implemented as a static, generic closure method.

GenericMethodParameterMapper ( IMetadataHost host, IMethodDefinition targetMethod, INestedTypeReference sourceType ) : System

Use this constructor when the anonymous delegate did capture a local or parameter and so was implemented as an instance, non-generic closure method within a generic class.

Rewrite ( IGenericMethodParameterReference genericMethodParameterReference ) : ITypeReference
Rewrite ( IGenericTypeParameterReference genericTypeParameterReference ) : ITypeReference
RewriteReference ( ILocalDefinition localDefinition ) : object

This is necessary only because the base rewriter for things like TargetExpression call this method and its definition in the base rewriter is to not visit it, but to just return it.

비공개 메소드들

메소드 설명
GenericMethodParameterMapper ( IMetadataHost host, IMethodDefinition targetMethod ) : System

메소드 상세

GenericMethodParameterMapper() 공개 메소드

Use this constructor when the anonymous delegate did not capture any locals or parameters and so was implemented as a static, generic closure method.
public GenericMethodParameterMapper ( IMetadataHost host, IMethodDefinition targetMethod, IMethodDefinition sourceMethod ) : System
host IMetadataHost
targetMethod IMethodDefinition
sourceMethod IMethodDefinition
리턴 System

GenericMethodParameterMapper() 공개 메소드

Use this constructor when the anonymous delegate did capture a local or parameter and so was implemented as an instance, non-generic closure method within a generic class.
public GenericMethodParameterMapper ( IMetadataHost host, IMethodDefinition targetMethod, INestedTypeReference sourceType ) : System
host IMetadataHost
targetMethod IMethodDefinition
sourceType INestedTypeReference
리턴 System

Rewrite() 공개 메소드

public Rewrite ( IGenericMethodParameterReference genericMethodParameterReference ) : ITypeReference
genericMethodParameterReference IGenericMethodParameterReference
리턴 ITypeReference

Rewrite() 공개 메소드

public Rewrite ( IGenericTypeParameterReference genericTypeParameterReference ) : ITypeReference
genericTypeParameterReference IGenericTypeParameterReference
리턴 ITypeReference

RewriteReference() 공개 메소드

This is necessary only because the base rewriter for things like TargetExpression call this method and its definition in the base rewriter is to not visit it, but to just return it.
public RewriteReference ( ILocalDefinition localDefinition ) : object
localDefinition ILocalDefinition
리턴 object