You can pass in parameters to Activator.CreateInstance, so it could be used for the other function. The only difference is that it would throw an exception if a constructor with the provided parameter signature is not found, instead of falling back on the default constructor or returning null, like the current implementation.
But, assuming that's not a problem, the two methods could be replaced with just
/// <summary>
/// Create a new instance of the specified object.
/// </summary>
static public object Create (this Type type)
{
return Activator.CreateInstance(type);
}
/// <summary>
/// Create a new instance of the specified object.
/// </summary>
static public object Create (this Type type, int size)
{
return Activator.CreateInstance(type, size);
}
Although, I haven't tested the performance of Activator vs invoking the constructor via reflection.