Ejemplo n.º 1
0
        static MethodBuilder CreateNewInstanceGetter(TypeBuilder typeBuilder, PropertyBuilder property,
                                                     ConstructorInfo constructor, MethodAttributes accessRights)
        {
            var getterMethod = CodeGenerationUtils.GetterMethodFor(typeBuilder, property, accessRights);

            CodeGenerationUtils.ReturnNewInstanceILInstructions(constructor, getterMethod);
            return(getterMethod);
        }
Ejemplo n.º 2
0
        private void CreateMetaDataGetter(MethodBuilder getterMethod,
                                          Type type,
                                          ITypeDescription typeDescription)
        {
            var returnType = getterMethod.ReturnType;

            CodeGenerationUtils.ReturnNewInstanceILInstructions(
                returnType.GetConstructors().Single(), getterMethod);
        }