예제 #1
0
 public IClrTypeReference Compile()
 {
     if (IsTypeNullable.HasValue || IsElementTypeNullable.HasValue)
     {
         Type rewritten = DotNetTypeInfoFactory.Rewrite(
             Type,
             !(IsTypeNullable ?? false),
             !(IsElementTypeNullable ?? false));
         return(new ClrTypeReference(rewritten, Context));
     }
     return(this);
 }
예제 #2
0
 internal static void RewriteClrType(
     this FieldDescriptionBase fieldDescription,
     Func <Type, TypeReference> createContext)
 {
     if (fieldDescription.IsNullable.HasValue &&
         fieldDescription.TypeReference.IsClrTypeReference())
     {
         fieldDescription.TypeReference = createContext(
             DotNetTypeInfoFactory.Rewrite(
                 fieldDescription.TypeReference.ClrType,
                 !fieldDescription.IsNullable.Value,
                 !fieldDescription.IsElementNullable.Value));
     }
 }