Formatting a type's name
You can let CSharpCodeProvider format Type names:

public static string FormatTypeName(this Type type)
{
    using (var c = new CSharpCodeProvider()) {
        var r = new CodeTypeReference(type);
        return c.GetTypeOutput(r);
    }
}