4 instantiations of TypeName
System.Reflection.Metadata (4)
System\Reflection\Metadata\TypeNameParser.cs (4)
187
TypeName result =
new
(fullName, assemblyName, declaringType: declaringType);
190
result =
new
(fullName: null, assemblyName, elementOrGenericType: result, declaringType, genericArgs);
197
result =
new
(fullName: null, assemblyName, elementOrGenericType: result, rankOrModifier: (sbyte)parsedModifier);
242
declaringType =
new
(fullTypeName, assemblyName, declaringType: declaringType, nestedNameLength: fullNameLength);
126 references to TypeName
System.Reflection.Metadata (33)
System\Reflection\Metadata\TypeName.cs (20)
35
private readonly
TypeName
? _elementOrGenericType;
36
private readonly
TypeName
? _declaringType;
40
private readonly ImmutableArray<
TypeName
> _genericArguments;
46
TypeName
? elementOrGenericType = default,
47
TypeName
? declaringType = default,
51
ImmutableArray<
TypeName
>.Builder? genericTypeArguments = default,
67
? ImmutableArray<
TypeName
>.Empty
82
/// Returns assembly name which contains this type, or null if this <see cref="
TypeName
"/> was not
95
public
TypeName
DeclaringType
256
/// Represents the total number of <see cref="
TypeName
"/> instances that are used to describe
262
/// as the total number of <see cref="
TypeName
"/> instances that would be created if
263
/// you were to totally deconstruct this instance and visit each intermediate <see cref="
TypeName
"/>
270
/// involves inspecting 8 <see cref="
TypeName
"/> instances total:
300
foreach (
TypeName
genericArgument in GetGenericArguments())
315
public
TypeName
GetElementType()
332
public
TypeName
GetGenericTypeDefinition()
350
public static
TypeName
Parse(ReadOnlySpan<char> typeName, TypeNameParseOptions? options = default)
360
public static bool TryParse(ReadOnlySpan<char> typeName, [NotNullWhen(true)] out
TypeName
? result, TypeNameParseOptions? options = default)
382
/// If this <see cref="
TypeName
"/> represents a constructed generic type, returns an array
393
ImmutableArray<
TypeName
> GetGenericArguments() => _genericArguments;
System\Reflection\Metadata\TypeNameParser.cs (10)
31
internal static
TypeName
? Parse(ReadOnlySpan<char> typeName, bool throwOnError, TypeNameParseOptions? options = default)
46
TypeName
? parsedName = parser.ParseNextTypeName(allowFullyQualifiedName: true, ref recursiveDepth);
68
private
TypeName
? ParseNextTypeName(bool allowFullyQualifiedName, ref int recursiveDepth)
88
ImmutableArray<
TypeName
>.Builder? genericArgs = null;
104
TypeName
? genericArg = ParseNextTypeName(allowFullyQualifiedName: doubleBrackets, ref recursiveDepth);
121
genericArgs = ImmutableArray.CreateBuilder<
TypeName
>(2);
186
TypeName
? declaringType = GetDeclaringType(fullName, nestedNameLengths, assemblyName);
187
TypeName
result = new(fullName, assemblyName, declaringType: declaringType);
229
private static
TypeName
? GetDeclaringType(string fullTypeName, List<int>? nestedNameLengths, AssemblyNameInfo? assemblyName)
236
TypeName
? declaringType = null;
System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
22
internal static string GetGenericTypeFullName(ReadOnlySpan<char> fullTypeName, ReadOnlySpan<
TypeName
> genericArgs)
30
foreach (
TypeName
genericArg in genericArgs)
System\Reflection\Metadata\TypeNameParserOptions.cs (1)
11
/// Limits the maximum value of <seealso cref="
TypeName
.GetNodeCount">node count</seealso> that parser can handle.
System.Resources.Extensions (48)
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ArrayOfClassesRecord.cs (2)
12
private
TypeName
? _elementTypeName;
27
public override
TypeName
ElementTypeName => _elementTypeName ??= MemberTypeInfo.GetElementTypeName();
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ArrayRecord.cs (1)
51
public abstract
TypeName
ElementTypeName { get; }
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ArraySingleObjectRecord.cs (3)
19
private static
TypeName
? s_elementTypeName;
25
public override
TypeName
ElementTypeName
26
=> s_elementTypeName ??=
TypeName
.Parse(typeof(object).FullName.AsSpan()).WithCoreLibAssemblyName();
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ArraySinglePrimitiveRecord.cs (3)
27
private static
TypeName
? s_elementTypeName;
37
public override
TypeName
ElementTypeName
38
=> s_elementTypeName ??=
TypeName
.Parse(typeof(T).FullName.AsSpan()).WithAssemblyName(typeof(T).GetAssemblyNameIncludingTypeForwards());
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ArraySingleStringRecord.cs (3)
19
private static
TypeName
? s_elementTypeName;
25
public override
TypeName
ElementTypeName
26
=> s_elementTypeName ??=
TypeName
.Parse(typeof(string).FullName.AsSpan()).WithCoreLibAssemblyName();
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\BinaryArrayRecord.cs (2)
29
private
TypeName
? _elementTypeName;
43
public override
TypeName
ElementTypeName
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ClassInfo.cs (2)
22
private
TypeName
? _typeName;
33
internal
TypeName
TypeName
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ClassRecord.cs (1)
27
public
TypeName
TypeName => ClassInfo.TypeName;
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ClassTypeInfo.cs (2)
20
internal ClassTypeInfo(
TypeName
typeName) => TypeName = typeName;
22
internal
TypeName
TypeName { get; }
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\MemberTypeInfo.cs (12)
155
TypeName
typeName = (
TypeName
)additionalInfo!;
189
TypeName
typeName = (
TypeName
)additionalInfo!;
210
internal
TypeName
GetElementTypeName()
217
return
TypeName
.Parse(typeof(string).FullName.AsSpan()).WithCoreLibAssemblyName();
219
return
TypeName
.Parse(typeof(string[]).FullName.AsSpan()).WithCoreLibAssemblyName();
221
return
TypeName
.Parse(typeof(object).FullName.AsSpan()).WithCoreLibAssemblyName();
223
return
TypeName
.Parse(typeof(object[]).FullName.AsSpan()).WithCoreLibAssemblyName();
246
?
TypeName
.Parse($"{name}[], {TypeNameExtensions.CoreLibAssemblyName}".AsSpan())
247
:
TypeName
.Parse(name.AsSpan()).WithCoreLibAssemblyName();
250
return (
TypeName
)additionalInfo!;
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\RectangularOrCustomOffsetArrayRecord.cs (2)
18
private
TypeName
? _elementTypeName;
46
public override
TypeName
ElementTypeName
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\Utils\TypeNameExtensions.cs (12)
16
internal static
TypeName
ParseNonSystemClassRecordTypeName(this string rawName, BinaryLibraryRecord libraryRecord, PayloadOptions payloadOptions)
22
TypeName
.TryParse(assemblyQualifiedName.AsSpan(), out
TypeName
? typeName, payloadOptions.TypeNameParseOptions);
42
internal static
TypeName
ParseSystemRecordTypeName(this string rawName, PayloadOptions payloadOptions)
47
TypeName
.TryParse(assemblyQualifiedName.AsSpan(), out
TypeName
? typeName, payloadOptions.TypeNameParseOptions);
53
internal static
TypeName
WithCoreLibAssemblyName(this
TypeName
systemType)
56
internal static
TypeName
WithAssemblyName(this
TypeName
typeName, string assemblyName)
65
TypeName
result =
TypeName
.Parse(assemblyQualifiedName.AsSpan());
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.ITypeResolver.cs (1)
21
Type GetType(
TypeName
typeName);
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.TypeResolver.cs (2)
38
Type ITypeResolver.GetType(
TypeName
typeName)
88
private static Type? GetSimplyNamedTypeFromAssembly(Assembly assembly,
TypeName
typeName)
System.Runtime.Serialization.BinaryFormat (45)
System\Runtime\Serialization\BinaryFormat\ArrayOfClassesRecord.cs (2)
12
private
TypeName
? _elementTypeName;
27
public override
TypeName
ElementTypeName => _elementTypeName ??= MemberTypeInfo.GetElementTypeName();
System\Runtime\Serialization\BinaryFormat\ArrayRecord.cs (1)
51
public abstract
TypeName
ElementTypeName { get; }
System\Runtime\Serialization\BinaryFormat\ArraySingleObjectRecord.cs (3)
19
private static
TypeName
? s_elementTypeName;
25
public override
TypeName
ElementTypeName
26
=> s_elementTypeName ??=
TypeName
.Parse(typeof(object).FullName.AsSpan()).WithCoreLibAssemblyName();
System\Runtime\Serialization\BinaryFormat\ArraySinglePrimitiveRecord.cs (3)
27
private static
TypeName
? s_elementTypeName;
37
public override
TypeName
ElementTypeName
38
=> s_elementTypeName ??=
TypeName
.Parse(typeof(T).FullName.AsSpan()).WithAssemblyName(typeof(T).GetAssemblyNameIncludingTypeForwards());
System\Runtime\Serialization\BinaryFormat\ArraySingleStringRecord.cs (3)
19
private static
TypeName
? s_elementTypeName;
25
public override
TypeName
ElementTypeName
26
=> s_elementTypeName ??=
TypeName
.Parse(typeof(string).FullName.AsSpan()).WithCoreLibAssemblyName();
System\Runtime\Serialization\BinaryFormat\BinaryArrayRecord.cs (2)
29
private
TypeName
? _elementTypeName;
43
public override
TypeName
ElementTypeName
System\Runtime\Serialization\BinaryFormat\ClassInfo.cs (2)
22
private
TypeName
? _typeName;
33
internal
TypeName
TypeName
System\Runtime\Serialization\BinaryFormat\ClassRecord.cs (1)
27
public
TypeName
TypeName => ClassInfo.TypeName;
System\Runtime\Serialization\BinaryFormat\ClassTypeInfo.cs (2)
20
internal ClassTypeInfo(
TypeName
typeName) => TypeName = typeName;
22
internal
TypeName
TypeName { get; }
System\Runtime\Serialization\BinaryFormat\MemberTypeInfo.cs (12)
155
TypeName
typeName = (
TypeName
)additionalInfo!;
189
TypeName
typeName = (
TypeName
)additionalInfo!;
210
internal
TypeName
GetElementTypeName()
217
return
TypeName
.Parse(typeof(string).FullName.AsSpan()).WithCoreLibAssemblyName();
219
return
TypeName
.Parse(typeof(string[]).FullName.AsSpan()).WithCoreLibAssemblyName();
221
return
TypeName
.Parse(typeof(object).FullName.AsSpan()).WithCoreLibAssemblyName();
223
return
TypeName
.Parse(typeof(object[]).FullName.AsSpan()).WithCoreLibAssemblyName();
246
?
TypeName
.Parse($"{name}[], {TypeNameExtensions.CoreLibAssemblyName}".AsSpan())
247
:
TypeName
.Parse(name.AsSpan()).WithCoreLibAssemblyName();
250
return (
TypeName
)additionalInfo!;
System\Runtime\Serialization\BinaryFormat\RectangularOrCustomOffsetArrayRecord.cs (2)
18
private
TypeName
? _elementTypeName;
46
public override
TypeName
ElementTypeName
System\Runtime\Serialization\BinaryFormat\Utils\TypeNameExtensions.cs (12)
16
internal static
TypeName
ParseNonSystemClassRecordTypeName(this string rawName, BinaryLibraryRecord libraryRecord, PayloadOptions payloadOptions)
22
TypeName
.TryParse(assemblyQualifiedName.AsSpan(), out
TypeName
? typeName, payloadOptions.TypeNameParseOptions);
42
internal static
TypeName
ParseSystemRecordTypeName(this string rawName, PayloadOptions payloadOptions)
47
TypeName
.TryParse(assemblyQualifiedName.AsSpan(), out
TypeName
? typeName, payloadOptions.TypeNameParseOptions);
53
internal static
TypeName
WithCoreLibAssemblyName(this
TypeName
systemType)
56
internal static
TypeName
WithAssemblyName(this
TypeName
typeName, string assemblyName)
65
TypeName
result =
TypeName
.Parse(assemblyQualifiedName.AsSpan());