<PackageReference Include="System.Reflection.Metadata" Version="11.0.0-rc.2.26504.105" />

System.Reflection.Metadata.TypeName

public sealed class TypeName

Returns assembly name that contains this type, or null if this TypeName was not created from a fully qualified name.

public string AssemblyQualifiedName { get; }

Gets the assembly-qualified name of the type; for example, "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

public TypeName DeclaringType { get; }

If this type is a nested type (see IsNested), gets the declaring type. If this type is not a nested type, throws.

public string FullName { get; }

Gets the full name of this type, including namespace, but without the assembly name; for example, "System.Int32". Nested types are represented with a '+'; for example, "MyNamespace.MyType+NestedType".

public bool IsArray { get; }

Gets a value that indicates whether this type represents any kind of array, regardless of the array's rank or its bounds.

public bool IsByRef { get; }

Gets a value that indicates whether this is a managed pointer type (for example, "ref int"). Managed pointer types are sometimes called byref types ( IsByRef).

public bool IsConstructedGenericType { get; }

Gets a value that indicates whether this type represents a constructed generic type (for example, "List<int>").

public bool IsNested { get; }

Gets a value that indicates whether this is a nested type (for example, "Namespace.Declaring+Nested"). For nested types DeclaringType returns their declaring type.

public bool IsPointer { get; }

Gets a value that indicates whether this type represents an unmanaged pointer (for example, "int*" or "void*"). Unmanaged pointer types are often just called pointers ( IsPointer).

public bool IsSimple { get; }

Gets a value that indicates whether this is a "plain" type; that is, not an array, not a pointer, not a reference, and not a constructed generic type. Examples of elemental types are "System.Int32", "System.Uri", and "YourNamespace.YourClass".

public bool IsSZArray { get; }

Gets a value that indicates whether this type represents a single-dimensional, zero-indexed array (for example, "int[]").

public bool IsVariableBoundArrayType { get; }

Gets a value that indicates whether this type represents a variable-bound array; that is, an array of rank greater than 1 (for example, "int[,]") or a single-dimensional array that isn't necessarily zero-indexed.

public string Name { get; }

Gets the name of this type, without the namespace and the assembly name; for example, "Int32". Nested types are represented without a '+'; for example, "MyNamespace.MyType+NestedType" is just "NestedType".

public string Namespace { get; }

Gets the namespace of this type, for example, "System".

public static TypeName Parse(ReadOnlySpan<char> typeName, TypeNameParseOptions options = null)

Parses a span of characters into a type name.

public static bool TryParse(ReadOnlySpan<char> typeName, out TypeName result, TypeNameParseOptions options = null)

Tries to parse a span of characters into a type name.

public static string Unescape(string name)

Converts any escaped characters in the input type name or namespace.

public int GetArrayRank()

Gets the number of dimensions in an array.

Gets the TypeName of the object encompassed or referred to by the current array, pointer, or reference type.

If this TypeName represents a constructed generic type, returns an array of all the generic arguments. Otherwise it returns an empty array.

Returns a TypeName object that represents a generic type name definition from which the current generic type name can be constructed.

public int GetNodeCount()

Gets the total number of TypeName instances that are used to describe this instance, including any generic arguments or underlying types.

public TypeName MakeArrayTypeName(int rank)

Creates a TypeName object representing an array of the current type, with the specified number of dimensions.

Creates a TypeName object that represents a managed reference to the current type.

Creates a new constructed generic type name.

Creates a TypeName object that represents a pointer to the current type.

Creates a TypeName object representing a one-dimensional array of the current type, with a lower bound of zero.

Creates a new TypeName object that represents the current simple name with the provided assembly name.