TypeExtensionsGetName(Type, TypeNameKind) Method

Gets the name of the type by the specified kind.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public static string GetName(
	this Type type,
	TypeNameKind kind
)

Parameters

type  Type
The type whose name is to be obtained.
kind  TypeNameKind
The formatting kind for the name to be retrieved.

Return Value

String
The name of the type by the specified kind.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

See the values of the TypeNameKind enum for the detailed differences from Type members such as Name, FullName and AssemblyQualifiedName.

Unlike the Type properties, the names produced by this method are never for runtime types.

This method always provides parseable type names by using the AssemblyQualifiedName kind. If the type contains generic arguments, then the result will be able to be parsed by the Reflector.ResolveType method.

See Also