public static bool IsLiteralType(this Type type)
        {
            if (type.IsNullableType())
            {
                type = Nullable.GetUnderlyingType(type);
            }

            return(LiteralTypes.Contains(type));
        }
        public static bool IsLiteralType(this Type type)
        {
            if (type.IsNullableType())
            {
                type = Nullable.GetUnderlyingType(type);
            }

            return(LiteralTypes.Contains(type) || typeof(Enum).IsAssignableFrom(type));
        }
 public Literal(LiteralTypes type)
 {
     this.Type = type;
 }
示例#4
0
 public JsonSerializer(LiteralTypes litTypes)
 {
     this.litTypes       = litTypes;
     this.circleDetector = new Map <object, string>();
 }