///
/// Creates an instance of the generic type specified using the default
/// constructor.
///
/// The type to instantiate.
/// The System.Type being instantiated.
/// An instance of the specified type.
///
/// typeof(MyObject).CreateInstance();
///
public static T CreateInstance<T>(this Type type) where T : new()
{
return Activator.CreateInstance<T>();
}
|