public static bool IsCreateable (Type type)
{
if (type != null && (type == typeof (object) || typeof(Delegate).IsAssignableFrom(type)))
return false;
if (!type.IsVisible || type.IsAbstract ||
type.IsInterface || type.IsPrimitive ||
type.IsGenericTypeDefinition)
return false;
// we like value types and arrays and things with default constructors
if (!type.IsValueType && !type.IsArray && type.GetConstructor (BindingFlags.Public | BindingFlags.Instance, null, Type.EmptyTypes, null) == null)
return false;
return true;
}