Example #1
0
        private static Type CodeGeneratePropertySerializer(Type propertyClassType)
        {
            CodeGenerationBuilder codeGenerationBuilder = new CodeGenerationBuilder("PropertySerializer: " + propertyClassType.FullName);

            PropertySerializerTypeCodeGenerator.AddPropertySerializerTypeCode(codeGenerationBuilder, propertyClassType);

            IEnumerable <Type> types = CodeGenerationManager.CompileRuntimeTempTypes(codeGenerationBuilder);

            return(types.Single());
        }
Example #2
0
        private static Type GetPropertySerializerType(Type propertyClassType)
        {
            string propertySerializerTypeName = PropertySerializerTypeCodeGenerator.CreateSerializerClassFullName(propertyClassType);

            Type propertySerializerType = TypeManager.TryGetType(propertySerializerTypeName);

            if (propertySerializerType == null)
            {
                propertySerializerType = CodeGeneratePropertySerializer(propertyClassType);
            }

            return(propertySerializerType);
        }