Ejemplo n.º 1
0
        public Type Generate()
        {
            TypeBuilder       typeBuilder       = CreateTypeBuilder();
            MethodImplementor methodImplementor =
                new MethodImplementor(typeBuilder, DefineInvocationHandlerField(typeBuilder));

            ImplementMethods(methodImplementor);
            return(typeBuilder.CreateType());
        }
Ejemplo n.º 2
0
 private void ImplementMethods(MethodImplementor methodImplementor)
 {
     foreach (Type currentType in new InterfaceLister().List(type))
     {
         foreach (MethodInfo methodInfo in currentType.GetMethods(ALL_INSTANCE_METHODS))
         {
             if (ShouldImplement(methodInfo))
             {
                 methodImplementor.Implement(methodInfo);
             }
         }
     }
 }
Ejemplo n.º 3
0
 private void ImplementMethods(MethodImplementor methodImplementor)
 {
     foreach (Type currentType in new InterfaceLister().List(type))
     {
         foreach (MethodInfo methodInfo in currentType.GetMethods(ALL_INSTANCE_METHODS))
         {
             if (ShouldImplement(methodInfo))
                 methodImplementor.Implement(methodInfo);
         }
     }
 }
Ejemplo n.º 4
0
        public Type Generate()
        {
            TypeBuilder typeBuilder = CreateTypeBuilder();
            MethodImplementor methodImplementor =
                new MethodImplementor(typeBuilder, DefineInvocationHandlerField(typeBuilder));

            ImplementMethods(methodImplementor);
            return typeBuilder.CreateType();
        }