Пример #1
0
 private static object TryCoerce(object value, out bool simpleType)
 {
     value = SDLUtil.TryCoerce(value, out simpleType);
     if (!simpleType)
     {
         System.Type type = value.GetType();
         if (value is Enum)
         {
             value      = (object)Util.GetName(type, value);
             simpleType = true;
         }
         else if (ReflectionHelper.IsNullable(type))
         {
             value = SDLUtil.TryCoerce(ReflectionHelper.GetValue(type.GetProperty("Value"), value), out simpleType);
         }
     }
     return(value);
 }