Exemplo 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);
        }
Exemplo n.º 2
0
        private void CreateMetaDataGetter(MethodBuilder getterMethod,
                                          Type type,
                                          ITypeDescription typeDescription)
        {
            var returnType = getterMethod.ReturnType;

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