public override void Emit(Type sourceType, Type targetType, CompilationContext context)
 {
     if (typeof(TSource) != sourceType)
     {
         context.EmitCast(typeof(TSource));
     }
     _invokerBuilder.Emit(context);
     if (targetType != typeof(TTarget))
     {
         context.EmitCast(targetType);
     }
     context.CurrentType = targetType;
 }
Beispiel #2
0
 public void Emit(CompilationContext context)
 {
     context.LoadSource();
     _invokerBuilder.Emit(context);
     context.CurrentType = typeof(TTarget);
 }
 protected override void EmitSource(CompilationContext context)
 {
     context.LoadSource();
     _invokerBuilder.Emit(context);
     context.CurrentType = SourceType;
 }