Beispiel #1
0
 private void CreateConstructor()
 {
     if (typeDefinition.TypeDefinitionType == TypeDefinitionType.InterfaceProxy)
     {
         typeBuilder.AddConstructor(constructorFields);
     }
     else
     {
         typeBuilder.AddConstructor(constructorFields, (typeDefinition as ClassProxyDefinition).Constructor);
     }
 }
        private void DefineConstructor(TypeBuilder typeBuilder, InvocationTypeDefinition invocationTypeDefinition)
        {
            Type targetType = invocationTypeDefinition.TypeDefinition.TargetType;

            if (targetType == null)
            {
                targetType = typeof(object);
            }
            typeBuilder.AddConstructor(new Type[] { targetType, typeof(IInterceptor[]), typeof(MemberInfo), typeof(MethodInfo), typeof(object), typeof(object[]) }, Constructors.InvocationDefaultConstructor);
        }