ReflectorReformatTypeName Method
Parses the specified
typeName and reformats it using the specified
kind, without actually resolving the type name to a
Type.
Namespace: KGySoft.ReflectionAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.5.0
public static string ReformatTypeName(
string typeName,
TypeNameKind kind
)
Public Shared Function ReformatTypeName (
typeName As String,
kind As TypeNameKind
) As String
public:
static String^ ReformatTypeName(
String^ typeName,
TypeNameKind kind
)
static member ReformatTypeName :
typeName : string *
kind : TypeNameKind -> string
- typeName String
- The type name to be parsed and reformatted.
- kind TypeNameKind
- A TypeNameKind value, specifying the format of the desired result.
StringA
String, containing the reformatted name of the specified
typeName.
The typical intended usage of this method is to strip unneeded information from type names. The lower the value of the specified kind, the shorted the result will be.
This method works for any kind of type names in any format that can be produced by the Type.Name, Type.ToString,
Type.FullName, Type.AssemblyQualifiedName members,
and the TypeExtensions.GetName method.
As this method does not actually resolve any type, the result cannot contain more details than the originally provided name. To get an arbitrarily detailed name
of a
Type use the
TypeExtensions.GetName method with an actual
Type instead.