7 instantiations of TypeName
System.Reflection.Metadata (7)
System\Reflection\Metadata\TypeName.cs (3)
608
return new
TypeName
(fullName: _fullName,
673
return new
TypeName
(fullName: null, AssemblyName, elementOrGenericType: this, declaringType: _declaringType, genericTypeArguments: typeArguments);
677
=> new
TypeName
(
System\Reflection\Metadata\TypeNameParser.cs (4)
217
TypeName result =
new
(fullName, assemblyName, declaringType: declaringType);
220
result =
new
(fullName: null, assemblyName, elementOrGenericType: result, declaringType, genericArgs);
230
result =
new
(fullName: null, assemblyName, elementOrGenericType: result, rankOrModifier: parsedModifier);
277
declaringType =
new
(fullTypeName, assemblyName, declaringType: declaringType, nestedNameLength: fullNameLength);
335 references to TypeName
ILCompiler.TypeSystem (16)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\CustomAttributeTypeNameParser.cs (16)
26
if (!
TypeName
.TryParse(name.AsSpan(), out
TypeName
parsed, s_typeNameParseOptions))
43
if (!
TypeName
.TryParse(name.AsSpan(), out
TypeName
parsed, s_typeNameParseOptions))
69
static bool IsFullyQualified(
TypeName
typeName)
83
foreach (
var
typeArgument in typeName.GetGenericArguments())
106
internal TypeDesc Resolve(
TypeName
typeName)
138
private TypeDesc GetSimpleType(
TypeName
typeName)
140
TypeName
topLevelTypeName = typeName;
183
private TypeDesc GetSimpleTypeFromModule(
TypeName
typeName, ModuleDesc module)
190
return ((MetadataType)type).GetNestedType(System.Text.Encoding.UTF8.GetBytes(
TypeName
.Unescape(typeName.Name)));
195
string fullName =
TypeName
.Unescape(typeName.FullName);
202
System.Text.Encoding.UTF8.GetBytes(
TypeName
.Unescape(typeName.Namespace)),
203
System.Text.Encoding.UTF8.GetBytes(
TypeName
.Unescape(typeName.Name)), throwIfNotFound: false);
206
private TypeDesc GetGenericType(
TypeName
typeName)
212
ImmutableArray<
TypeName
> typeArguments = typeName.GetGenericArguments();
illink (14)
Linker\TypeNameResolver.cs (9)
9
using TypeName = System.Reflection.Metadata.
TypeName
;
39
if (!
TypeName
.TryParse(typeNameString, out
TypeName
? parsedTypeName, s_typeNameParseOptions))
60
TypeReference? ResolveTypeName(AssemblyDefinition originalAssembly,
TypeName
? typeName, List<TypeResolutionRecord> typeResolutionRecords, bool fallbackToCoreLib)
81
foreach (
var
arg in typeName.GetGenericArguments())
109
TypeName
topLevelTypeName = typeName;
143
TypeDefinition? GetSimpleTypeFromModule(
TypeName
typeName, ModuleDefinition module)
150
return GetNestedType(type,
TypeName
.Unescape(typeName.Name));
153
return module.ResolveType(
TypeName
.Unescape(typeName.FullName), _metadataResolver);
Linker\TypeNameResolver.WithDiagnostics.cs (5)
11
using TypeName = System.Reflection.Metadata.
TypeName
;
29
if (!
TypeName
.TryParse(typeNameString, out
TypeName
? parsedTypeName, s_typeNameParseOptions))
58
static bool IsFullyQualified(
TypeName
typeName)
68
foreach (
var
typeArgument in typeName.GetGenericArguments())
Microsoft.Private.Windows.Core (68)
System\Private\Windows\BinaryFormat\ITypeResolver.cs (2)
16
Type BindToType(
TypeName
typeName);
21
bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type);
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (22)
17
private static Dictionary<
TypeName
, Type>? s_knownTypes;
31
public static bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type)
38
{
TypeName
.Parse(Types.ByteType), typeof(byte) },
39
{
TypeName
.Parse(Types.SByteType), typeof(sbyte) },
40
{
TypeName
.Parse(Types.Int16Type), typeof(short) },
41
{
TypeName
.Parse(Types.UInt16Type), typeof(ushort) },
42
{
TypeName
.Parse(Types.Int32Type), typeof(int) },
43
{
TypeName
.Parse(Types.UInt32Type), typeof(uint) },
44
{
TypeName
.Parse(Types.Int64Type), typeof(long) },
45
{
TypeName
.Parse(Types.UInt64Type), typeof(ulong) },
46
{
TypeName
.Parse(Types.DoubleType), typeof(double) },
47
{
TypeName
.Parse(Types.SingleType), typeof(float) },
48
{
TypeName
.Parse(Types.CharType), typeof(char) },
49
{
TypeName
.Parse(Types.BooleanType), typeof(bool) },
50
{
TypeName
.Parse(Types.StringType), typeof(string) },
51
{
TypeName
.Parse(Types.DecimalType), typeof(decimal) },
52
{
TypeName
.Parse(Types.DateTimeType), typeof(DateTime) },
53
{
TypeName
.Parse(Types.TimeSpanType), typeof(TimeSpan) },
54
{
TypeName
.Parse(Types.IntPtrType), typeof(IntPtr) },
55
{
TypeName
.Parse(Types.UIntPtrType), typeof(UIntPtr) },
56
{
TypeName
.Parse(Types.NotSupportedExceptionType), typeof(NotSupportedException) },
167
bool INrbfSerializer.TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type) => TryBindToType(typeName, out type);
System\Private\Windows\Nrbf\INrbfSerializer.cs (2)
34
bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type);
47
/// <see cref="TryBindToType(
TypeName
, out Type?)"/> and <see cref="TryGetObject(SerializationRecord, out object?)"/>
System\Private\Windows\Ole\Composition.cs (1)
193
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
719
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\DataRequest.cs (2)
28
/// <see cref="
TypeName
"/>s read from the deserialized stream.
30
public Func<
TypeName
, Type?>? Resolver { get; init; } = null;
System\Private\Windows\Ole\DataStore.cs (1)
199
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\IDataObjectInternal.cs (5)
96
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)"/>
103
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)"/>
112
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)"/>
122
/// A user-provided function that maps <see cref="
TypeName
"/> to <see cref="Type"/>.
151
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\TypeBinder.cs (6)
43
private readonly Func<
TypeName
, Type?>? _resolver;
46
private Dictionary<FullyQualifiedTypeName,
TypeName
>? _cachedTypeNames;
87
if (!_cachedTypeNames.TryGetValue(fullName, out
TypeName
? parsed))
89
parsed =
TypeName
.Parse(fullName.ToString());
96
public Type BindToType(
TypeName
typeName) => TryBindToType(typeName, out Type? type)
102
public bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type)
System\Reflection\Metadata\TypeNameComparer.cs (6)
7
/// Compares <see cref="
TypeName
"/>s.
9
internal sealed class TypeNameComparer : IEqualityComparer<
TypeName
>
32
public bool Equals(
TypeName
? x,
TypeName
? y)
47
public int GetHashCode(
TypeName
obj)
63
foreach (
TypeName
genericName in obj.GetGenericArguments())
System\TypeExtensions.cs (16)
12
/// Helper methods for comparing <see cref="Type"/>s and <see cref="
TypeName
"/>s.
24
TypeName
typeName,
70
ImmutableArray<
TypeName
> genericNames = typeName.GetGenericArguments();
95
/// <inheritdoc cref="Matches(Type,
TypeName
, TypeNameComparison)"/>
96
internal static bool Matches(this
TypeName
x,
TypeName
y, TypeNameComparison comparison = TypeNameComparison.All)
130
ImmutableArray<
TypeName
> genericNamesY = y.GetGenericArguments();
131
ImmutableArray<
TypeName
> genericNamesX = x.GetGenericArguments();
217
/// Convert <paramref name="type"/> to <see cref="
TypeName
"/>. Take into account type forwarding in order
218
/// to create <see cref="
TypeName
"/> compatible with the type names serialized to the binary format.This
219
/// method removes nullability wrapper from the top level type only because <see cref="
TypeName
"/> in the
222
internal static
TypeName
ToTypeName(this Type type)
226
return
TypeName
.Parse(type.AssemblyQualifiedName ?? type.FullName);
238
/// Helper method that allows non-allocating conversion of a interpolated string to a <see cref="
TypeName
"/>.
240
internal static
TypeName
ToTypeName(ref ValueStringBuilder builder)
244
return
TypeName
.Parse(builder.AsSpan());
System\Types.cs (4)
49
/// <inheritdoc cref="
TypeName
.Parse(ReadOnlySpan{char}, TypeNameParseOptions?)"/>
53
/// <see cref="
TypeName
.Parse(ReadOnlySpan{char}, TypeNameParseOptions?)"/>
56
public static
TypeName
ToTypeName(ref ValueStringBuilder builder)
60
return
TypeName
.Parse(builder.AsSpan());
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\MyServices\ClipboardProxy.vb (2)
196
''' <inheritdoc cref="Clipboard.TryGetData(Of T)(String, Func(Of
TypeName
, Type), ByRef T)" />
197
Public Function TryGetData(Of T)(format As String, resolver As Func(Of
TypeName
, Type), <Out> ByRef data As T) As Boolean
PresentationCore (18)
System\Windows\clipboard.cs (9)
301
/// <see cref="
TypeName
"/> is allowed or throws a <see cref="NotSupportedException"/> if <see cref="
TypeName
"/> is not
325
/// <see cref="
TypeName
"/> parameter can be matched according to the user requirements, for example, only namespace-qualified
365
/// Avoid loading assemblies named in the <see cref="
TypeName
"/> argument of your <paramref name="resolver"/>.
371
/// should be aware of <see cref="
TypeName
"/>s coming in with either .NET Framework assembly names or .NET ones.
379
/// <see cref="
TypeName
.FullName"/> property.
443
Func<
TypeName
, Type?> resolver,
461
/// You must use the <see cref="TryGetData{T}(string, Func{
TypeName
, Type?}, out T)"/> with an explicit resolver.
475
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, out T)"/>
System\Windows\dataobject.cs (3)
142
/// <inheritdoc cref="Clipboard.TryGetData{T}(string, Func{
TypeName
, Type}, out T)"/>
146
Func<
TypeName
, Type?> resolver,
173
Func<
TypeName
, Type?>? resolver,
System\Windows\DataObjectExtensions.cs (2)
56
/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{Reflection.Metadata.
TypeName
, Type}, bool, out T)"/>
63
Func<Reflection.Metadata.
TypeName
, Type?> resolver,
System\Windows\ITypedDataObject.cs (2)
41
/// <inheritdoc cref="IDataObjectInternal.TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)" />
45
Func<
TypeName
, Type?> resolver,
System\Windows\Nrbf\WpfNrbfSerializer.cs (1)
24
public static bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type)
System\Windows\Ole\DataObjectAdapter.cs (1)
44
Func<
TypeName
, Type?> resolver,
System.Formats.Nrbf (61)
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (2)
22
private
TypeName
? _typeName;
35
public override
TypeName
TypeName
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
24
public override
TypeName
TypeName
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (1)
36
public override
TypeName
TypeName => TypeNameHelpers.GetPrimitiveSZArrayTypeName(TypeNameHelpers.GetPrimitiveType<T>());
System\Formats\Nrbf\ArraySingleStringRecord.cs (1)
25
public override
TypeName
TypeName => TypeNameHelpers.GetPrimitiveSZArrayTypeName(TypeNameHelpers.StringPrimitiveType);
System\Formats\Nrbf\BinaryLibraryRecord.cs (2)
33
public override
TypeName
TypeName =>
TypeName
.Parse(nameof(BinaryLibraryRecord).AsSpan());
System\Formats\Nrbf\ClassInfo.cs (2)
23
private
TypeName
? _typeName;
34
internal
TypeName
TypeName
System\Formats\Nrbf\ClassRecord.cs (1)
23
public override
TypeName
TypeName => ClassInfo.TypeName;
System\Formats\Nrbf\ClassTypeInfo.cs (2)
20
internal ClassTypeInfo(
TypeName
typeName) => TypeName = typeName;
22
internal
TypeName
TypeName { get; }
System\Formats\Nrbf\JaggedArrayRecord.cs (2)
26
private
TypeName
? _typeName;
43
public override
TypeName
TypeName => _typeName ??= _memberTypeInfo.GetArrayTypeName(ArrayInfo);
System\Formats\Nrbf\MemberReferenceRecord.cs (1)
34
public override
TypeName
TypeName => GetReferencedRecord().TypeName;
System\Formats\Nrbf\MemberTypeInfo.cs (3)
113
internal
TypeName
GetArrayTypeName(ArrayInfo arrayInfo)
117
TypeName
elementTypeName = binaryType switch
125
BinaryType.SystemClass => (
TypeName
)additionalInfo!,
System\Formats\Nrbf\MessageEndRecord.cs (2)
27
public override
TypeName
TypeName =>
TypeName
.Parse(nameof(MessageEndRecord).AsSpan());
System\Formats\Nrbf\NrbfDecoder.cs (5)
389
TypeName
typeName = binaryType == BinaryType.SystemClass ? (
TypeName
)additionalInfo! : ((ClassTypeInfo)additionalInfo!).TypeName;
405
TypeName
typeName = binaryType == BinaryType.SystemClass ? (
TypeName
)additionalInfo! : ((ClassTypeInfo)additionalInfo!).TypeName;
439
else if (binaryType == BinaryType.SystemClass && ((
TypeName
)additionalInfo!).IsArray)
System\Formats\Nrbf\NullsRecord.cs (2)
15
public override
TypeName
TypeName =>
TypeName
.Parse(GetType().Name.AsSpan());
System\Formats\Nrbf\PayloadOptions.cs (1)
19
/// Gets or sets configuration options for parsing <see cref="
TypeName
"/> instances.
System\Formats\Nrbf\PrimitiveTypeRecordOfT.cs (1)
37
public override
TypeName
TypeName => TypeNameHelpers.GetPrimitiveTypeName(TypeNameHelpers.GetPrimitiveType<T>());
System\Formats\Nrbf\RectangularArrayRecord.cs (2)
23
private
TypeName
? _typeName;
41
public override
TypeName
TypeName
System\Formats\Nrbf\SerializationRecord.cs (3)
44
public abstract
TypeName
TypeName { get; }
63
private static bool Matches(Type type,
TypeName
typeName)
123
ImmutableArray<
TypeName
> genericNames = typeName.GetGenericArguments();
System\Formats\Nrbf\SerializedStreamHeaderRecord.cs (2)
27
public override
TypeName
TypeName =>
TypeName
.Parse(nameof(SerializedStreamHeaderRecord).AsSpan());
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
31
TypeName
typeName = classInfo.TypeName;
System\Formats\Nrbf\SZArrayOfRecords.cs (2)
17
private
TypeName
? _typeName;
32
public override
TypeName
TypeName
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (22)
20
private static readonly
TypeName
?[] s_primitiveTypeNames = new
TypeName
?[(int)UIntPtrPrimitiveType + 1];
21
private static readonly
TypeName
?[] s_primitiveSZArrayTypeNames = new
TypeName
?[(int)UIntPtrPrimitiveType + 1];
24
internal static
TypeName
GetPrimitiveTypeName(PrimitiveType primitiveType)
26
TypeName
? typeName = s_primitiveTypeNames[(int)primitiveType];
53
s_primitiveTypeNames[(int)primitiveType] = typeName =
TypeName
.Parse(fullName.AsSpan()).WithCoreLibAssemblyName();
58
internal static
TypeName
GetPrimitiveSZArrayTypeName(PrimitiveType primitiveType)
60
TypeName
? typeName = s_primitiveSZArrayTypeNames[(int)primitiveType];
110
internal static
TypeName
ParseNonSystemClassRecordTypeName(this string rawName, BinaryLibraryRecord libraryRecord, PayloadOptions payloadOptions)
133
TypeName
.TryParse(assemblyQualifiedName.AsSpan(), out
TypeName
? typeName, payloadOptions.TypeNameParseOptions);
153
internal static
TypeName
ParseSystemRecordTypeName(this string rawName, PayloadOptions payloadOptions)
157
internal static
TypeName
WithCoreLibAssemblyName(this
TypeName
systemType)
160
private static
TypeName
With(this
TypeName
typeName, AssemblyNameInfo assemblyName)
170
TypeName
newElementType = typeName.GetElementType().With(assemblyName);
178
TypeName
newGenericTypeDefinition = typeName.GetGenericTypeDefinition().With(assemblyName);
193
private static
TypeName
ParseWithoutAssemblyName(string rawName, PayloadOptions payloadOptions)
195
if (!
TypeName
.TryParse(rawName.AsSpan(), out
TypeName
? typeName, payloadOptions.TypeNameParseOptions)
System.Private.Windows.Core (69)
System\Private\Windows\BinaryFormat\ITypeResolver.cs (2)
16
Type BindToType(
TypeName
typeName);
21
bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type);
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (21)
17
private static Dictionary<
TypeName
, Type>? s_knownTypes;
31
public static bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type)
38
{
TypeName
.Parse(Types.ByteType), typeof(byte) },
39
{
TypeName
.Parse(Types.SByteType), typeof(sbyte) },
40
{
TypeName
.Parse(Types.Int16Type), typeof(short) },
41
{
TypeName
.Parse(Types.UInt16Type), typeof(ushort) },
42
{
TypeName
.Parse(Types.Int32Type), typeof(int) },
43
{
TypeName
.Parse(Types.UInt32Type), typeof(uint) },
44
{
TypeName
.Parse(Types.Int64Type), typeof(long) },
45
{
TypeName
.Parse(Types.UInt64Type), typeof(ulong) },
46
{
TypeName
.Parse(Types.DoubleType), typeof(double) },
47
{
TypeName
.Parse(Types.SingleType), typeof(float) },
48
{
TypeName
.Parse(Types.CharType), typeof(char) },
49
{
TypeName
.Parse(Types.BooleanType), typeof(bool) },
50
{
TypeName
.Parse(Types.StringType), typeof(string) },
51
{
TypeName
.Parse(Types.DecimalType), typeof(decimal) },
52
{
TypeName
.Parse(Types.DateTimeType), typeof(DateTime) },
53
{
TypeName
.Parse(Types.TimeSpanType), typeof(TimeSpan) },
54
{
TypeName
.Parse(Types.IntPtrType), typeof(IntPtr) },
55
{
TypeName
.Parse(Types.UIntPtrType), typeof(UIntPtr) },
56
{
TypeName
.Parse(Types.NotSupportedExceptionType), typeof(NotSupportedException) },
System\Private\Windows\Nrbf\INrbfSerializer.cs (2)
34
bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type);
47
/// <see cref="TryBindToType(
TypeName
, out Type?)"/> and <see cref="TryGetObject(SerializationRecord, out object?)"/>
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
586
|| !
TypeName
.TryParse(assemblyQualifiedTypeName, out
TypeName
? typeName))
System\Private\Windows\Ole\Composition.cs (1)
193
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
719
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\DataRequest.cs (2)
28
/// <see cref="
TypeName
"/>s read from the deserialized stream.
30
public Func<
TypeName
, Type?>? Resolver { get; init; } = null;
System\Private\Windows\Ole\DataStore.cs (1)
199
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\IDataObjectInternal.cs (5)
96
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)"/>
103
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)"/>
112
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)"/>
122
/// A user-provided function that maps <see cref="
TypeName
"/> to <see cref="Type"/>.
151
Func<
TypeName
, Type?> resolver,
System\Private\Windows\Ole\TypeBinder.cs (6)
43
private readonly Func<
TypeName
, Type?>? _resolver;
46
private Dictionary<FullyQualifiedTypeName,
TypeName
>? _cachedTypeNames;
87
if (!_cachedTypeNames.TryGetValue(fullName, out
TypeName
? parsed))
89
parsed =
TypeName
.Parse(fullName.ToString());
96
public Type BindToType(
TypeName
typeName) => TryBindToType(typeName, out Type? type)
102
public bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type)
System\Reflection\Metadata\TypeNameComparer.cs (6)
7
/// Compares <see cref="
TypeName
"/>s.
9
internal sealed class TypeNameComparer : IEqualityComparer<
TypeName
>
32
public bool Equals(
TypeName
? x,
TypeName
? y)
47
public int GetHashCode(
TypeName
obj)
63
foreach (
TypeName
genericName in obj.GetGenericArguments())
System\TypeExtensions.cs (16)
12
/// Helper methods for comparing <see cref="Type"/>s and <see cref="
TypeName
"/>s.
24
TypeName
typeName,
70
ImmutableArray<
TypeName
> genericNames = typeName.GetGenericArguments();
95
/// <inheritdoc cref="Matches(Type,
TypeName
, TypeNameComparison)"/>
96
internal static bool Matches(this
TypeName
x,
TypeName
y, TypeNameComparison comparison = TypeNameComparison.All)
130
ImmutableArray<
TypeName
> genericNamesY = y.GetGenericArguments();
131
ImmutableArray<
TypeName
> genericNamesX = x.GetGenericArguments();
217
/// Convert <paramref name="type"/> to <see cref="
TypeName
"/>. Take into account type forwarding in order
218
/// to create <see cref="
TypeName
"/> compatible with the type names serialized to the binary format.This
219
/// method removes nullability wrapper from the top level type only because <see cref="
TypeName
"/> in the
222
internal static
TypeName
ToTypeName(this Type type)
226
return
TypeName
.Parse(type.AssemblyQualifiedName ?? type.FullName);
238
/// Helper method that allows non-allocating conversion of a interpolated string to a <see cref="
TypeName
"/>.
240
internal static
TypeName
ToTypeName(ref ValueStringBuilder builder)
244
return
TypeName
.Parse(builder.AsSpan());
System\Types.cs (4)
49
/// <inheritdoc cref="
TypeName
.Parse(ReadOnlySpan{char}, TypeNameParseOptions?)"/>
53
/// <see cref="
TypeName
.Parse(ReadOnlySpan{char}, TypeNameParseOptions?)"/>
56
public static
TypeName
ToTypeName(ref ValueStringBuilder builder)
60
return
TypeName
.Parse(builder.AsSpan());
System.Reflection.Metadata (59)
System\Reflection\Metadata\TypeName.cs (47)
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
75
TypeName
? elementOrGenericType,
76
TypeName
? declaringType,
77
ImmutableArray<
TypeName
> genericTypeArguments,
133
/// Returns assembly name which contains this type, or null if this <see cref="
TypeName
"/> was not
146
public
TypeName
DeclaringType
210
foreach (
TypeName
genericArg in GetGenericArguments())
376
TypeName
rootTypeName = this;
414
/// Represents the total number of <see cref="
TypeName
"/> instances that are used to describe
420
/// as the total number of <see cref="
TypeName
"/> instances that would be created if
421
/// you were to totally deconstruct this instance and visit each intermediate <see cref="
TypeName
"/>
428
/// involves inspecting 8 <see cref="
TypeName
"/> instances total:
441
/// <exception cref="OverflowException">The total number of <see cref="
TypeName
"/> instances that are used to describe
459
foreach (
TypeName
genericArgument in GetGenericArguments())
479
public
TypeName
GetElementType()
496
public
TypeName
GetGenericTypeDefinition()
514
public static
TypeName
Parse(ReadOnlySpan<char> typeName, TypeNameParseOptions? options = default)
524
public static bool TryParse(ReadOnlySpan<char> typeName, [NotNullWhen(true)] out
TypeName
? result, TypeNameParseOptions? options = default)
565
/// If this <see cref="
TypeName
"/> represents a constructed generic type, returns an array
576
ImmutableArray<
TypeName
> GetGenericArguments() => _genericArguments;
581
/// Creates a new <see cref="
TypeName
" /> object that represents current simple name with provided assembly name.
586
public
TypeName
WithAssemblyName(AssemblyNameInfo? assemblyName)
604
TypeName
? declaringType = IsNested
612
genericTypeArguments: ImmutableArray<
TypeName
>.Empty,
617
/// Creates a <see cref="
TypeName
" /> object representing a one-dimensional array
621
/// A <see cref="
TypeName
" /> object representing a one-dimensional array
624
public
TypeName
MakeSZArrayTypeName() => MakeElementTypeName(TypeNameParserHelpers.SZArray);
627
/// Creates a <see cref="
TypeName
" /> object representing an array of the current type,
632
/// A <see cref="
TypeName
" /> object representing an array of the current type,
636
public
TypeName
MakeArrayTypeName(int rank)
642
/// Creates a <see cref="
TypeName
" /> object that represents a pointer to the current type.
645
/// A <see cref="
TypeName
" /> object that represents a pointer to the current type.
647
public
TypeName
MakePointerTypeName() => MakeElementTypeName(TypeNameParserHelpers.Pointer);
650
/// Creates a <see cref="
TypeName
" /> object that represents a managed reference to the current type.
653
/// A <see cref="
TypeName
" /> object that represents a managed reference to the current type.
655
public
TypeName
MakeByRefTypeName() => MakeElementTypeName(TypeNameParserHelpers.ByRef);
662
/// A <see cref="
TypeName
" /> representing the constructed type name formed by using the elements
666
public
TypeName
MakeGenericTypeName(ImmutableArray<
TypeName
> typeArguments)
676
private
TypeName
MakeElementTypeName(int rankOrModifier)
682
genericTypeArguments: ImmutableArray<
TypeName
>.Empty,
System\Reflection\Metadata\TypeNameParseOptions.cs (2)
11
/// Limits the maximum value of <seealso cref="
TypeName
.GetNodeCount">node count</seealso> that parser can handle.
15
/// Setting this to a large value can render <see cref="
TypeName
"/> susceptible to Denial of Service
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);
70
private
TypeName
? ParseNextTypeName(bool allowFullyQualifiedName, ref int recursiveDepth)
92
ImmutableArray<
TypeName
>.Builder? genericArgs = null;
108
TypeName
? genericArg = ParseNextTypeName(allowFullyQualifiedName: doubleBrackets, ref recursiveDepth);
125
genericArgs = ImmutableArray.CreateBuilder<
TypeName
>(2);
216
TypeName
? declaringType = GetDeclaringType(fullName, nestedNameLengths, assemblyName);
217
TypeName
result = new(fullName, assemblyName, declaringType: declaringType);
262
private static
TypeName
? GetDeclaringType(string fullTypeName, List<int>? nestedNameLengths, AssemblyNameInfo? assemblyName)
271
TypeName
? declaringType = null;
System.Resources.Extensions (3)
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.Windows.Forms (25)
System\Resources\ResXSerializationBinder.cs (4)
40
if (_typeResolver is null || !
TypeName
.TryParse($"{typeName}, {assemblyName}".AsSpan(), out
TypeName
? parsed))
83
&&
TypeName
.TryParse(assemblyQualifiedTypeName.AsSpan(), out
TypeName
? parsed)
System\Windows\Forms\Nrbf\WinFormsNrbfSerializer.cs (2)
17
private static Dictionary<
TypeName
, Type>? s_knownTypes;
22
public static bool TryBindToType(
TypeName
typeName, [NotNullWhen(true)] out Type? type)
System\Windows\Forms\OLE\Clipboard.cs (9)
165
/// <see cref="
TypeName
"/> is allowed or throws a <see cref="NotSupportedException"/> if <see cref="
TypeName
"/> is not
189
/// <see cref="
TypeName
"/> parameter can be matched according to the user requirements, for example, only namespace-qualified
229
/// Avoid loading assemblies named in the <see cref="
TypeName
"/> argument of your <paramref name="resolver"/>.
235
/// should be aware of <see cref="
TypeName
"/>s coming in with either .NET Framework assembly names or .NET ones.
243
/// <see cref="
TypeName
.FullName"/> property.
307
Func<
TypeName
, Type?> resolver,
325
/// You must use the <see cref="TryGetData{T}(string, Func{
TypeName
, Type?}, out T)"/> with an explicit resolver.
339
/// <inheritdoc cref="TryGetData{T}(string, Func{
TypeName
, Type}, out T)"/>
System\Windows\Forms\OLE\DataObject.cs (5)
150
/// <inheritdoc cref="Clipboard.TryGetData{T}(string, Func{
TypeName
, Type}, out T)"/>
154
Func<
TypeName
, Type?> resolver,
183
/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)" />
187
Func<
TypeName
, Type?>? resolver,
265
Func<
TypeName
, Type?>? resolver,
System\Windows\Forms\OLE\DataObjectAdapter.cs (1)
41
Func<
TypeName
, Type?> resolver,
System\Windows\Forms\OLE\DataObjectExtensions.cs (2)
52
/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{Reflection.Metadata.
TypeName
, Type}, bool, out T)"/>
59
Func<Reflection.Metadata.
TypeName
, Type?> resolver,
System\Windows\Forms\OLE\ITypedDataObject.cs (2)
39
/// <inheritdoc cref="IDataObjectInternal.TryGetData{T}(string, Func{
TypeName
, Type}, bool, out T)" />
43
Func<
TypeName
, Type?> resolver,