public static bool ToBool(object value)
{
if (null == value) return false;
if (value is bool) return (bool) value;
if (value is string)
return !string.IsNullOrEmpty((string) value);
Type type = value.GetType();
var dispatcher = GetDispatcher(value, "$ToBool$", new[] {type}, () => CreateBoolConverter(type));
return
(bool)
dispatcher(value, new[] {value});
}