148 references to Parse
System.Formats.Nrbf (5)
System\Formats\Nrbf\BinaryLibraryRecord.cs (1)
33
public override TypeName TypeName => TypeName.
Parse
(nameof(BinaryLibraryRecord).AsSpan());
System\Formats\Nrbf\MessageEndRecord.cs (1)
27
public override TypeName TypeName => TypeName.
Parse
(nameof(MessageEndRecord).AsSpan());
System\Formats\Nrbf\NullsRecord.cs (1)
15
public override TypeName TypeName => TypeName.
Parse
(GetType().Name.AsSpan());
System\Formats\Nrbf\SerializedStreamHeaderRecord.cs (1)
27
public override TypeName TypeName => TypeName.
Parse
(nameof(SerializedStreamHeaderRecord).AsSpan());
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (1)
53
s_primitiveTypeNames[(int)primitiveType] = typeName = TypeName.
Parse
(fullName.AsSpan()).WithCoreLibAssemblyName();
System.Private.Windows.Core (25)
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (19)
36
{ TypeName.
Parse
(Types.ByteType), typeof(byte) },
37
{ TypeName.
Parse
(Types.SByteType), typeof(sbyte) },
38
{ TypeName.
Parse
(Types.Int16Type), typeof(short) },
39
{ TypeName.
Parse
(Types.UInt16Type), typeof(ushort) },
40
{ TypeName.
Parse
(Types.Int32Type), typeof(int) },
41
{ TypeName.
Parse
(Types.UInt32Type), typeof(uint) },
42
{ TypeName.
Parse
(Types.Int64Type), typeof(long) },
43
{ TypeName.
Parse
(Types.UInt64Type), typeof(ulong) },
44
{ TypeName.
Parse
(Types.DoubleType), typeof(double) },
45
{ TypeName.
Parse
(Types.SingleType), typeof(float) },
46
{ TypeName.
Parse
(Types.CharType), typeof(char) },
47
{ TypeName.
Parse
(Types.BooleanType), typeof(bool) },
48
{ TypeName.
Parse
(Types.StringType), typeof(string) },
49
{ TypeName.
Parse
(Types.DecimalType), typeof(decimal) },
50
{ TypeName.
Parse
(Types.DateTimeType), typeof(DateTime) },
51
{ TypeName.
Parse
(Types.TimeSpanType), typeof(TimeSpan) },
52
{ TypeName.
Parse
(Types.IntPtrType), typeof(IntPtr) },
53
{ TypeName.
Parse
(Types.UIntPtrType), typeof(UIntPtr) },
54
{ TypeName.
Parse
(Types.NotSupportedExceptionType), typeof(NotSupportedException) },
System\Private\Windows\Ole\TypeBinder.cs (1)
81
parsed = TypeName.
Parse
(fullName.ToString());
System\TypeExtensions.cs (2)
227
return TypeName.
Parse
(type.AssemblyQualifiedName ?? type.FullName);
245
return TypeName.
Parse
(builder.AsSpan());
System\Types.cs (3)
49
/// <inheritdoc cref="TypeName.
Parse
(ReadOnlySpan{char}, TypeNameParseOptions?)"/>
53
/// <see cref="TypeName.
Parse
(ReadOnlySpan{char}, TypeNameParseOptions?)"/>
60
return TypeName.
Parse
(builder.AsSpan());
System.Private.Windows.Core.Tests (117)
System\Private\Windows\Nrbf\CoreNrbfSerializerTests.cs (1)
79
TypeName typeName = TypeName.
Parse
(typeNameString);
System\Private\Windows\Ole\BinaryFormatUtilitiesTests.cs (2)
1094
(typeof(MyClass1), TypeName.
Parse
(typeof(MyClass1).AssemblyQualifiedName)),
1095
(typeof(MyClass2), TypeName.
Parse
(typeof(MyClass2).AssemblyQualifiedName))
System\Private\Windows\Ole\TypeBinderTests.cs (6)
61
TypeName typeName = TypeName.
Parse
(type.AssemblyQualifiedName);
87
TypeName typeName = TypeName.
Parse
(type.AssemblyQualifiedName);
104
TypeName typeName = TypeName.
Parse
(type.AssemblyQualifiedName);
123
binder.TryBindToType(TypeName.
Parse
(typeof(int).AssemblyQualifiedName), out Type? boundType).Should().Be(true);
138
binder.TryBindToType(TypeName.
Parse
(typeof(int).AssemblyQualifiedName), out Type? boundType).Should().Be(false);
153
binder.TryBindToType(TypeName.
Parse
(typeof(int).AssemblyQualifiedName), out Type? boundType).Should().Be(true);
System\Reflection\Metadata\TypeNameComparerTests.cs (69)
12
{ TypeName.
Parse
(typeof(int).AssemblyQualifiedName), typeof(int) },
13
{ TypeName.
Parse
($"{typeof(int).FullName}, {typeof(int).Assembly.FullName}"), typeof(int) },
14
{ TypeName.
Parse
(typeof(int[]).AssemblyQualifiedName), typeof(int[]) },
15
{ TypeName.
Parse
($"{typeof(int[]).FullName}, {typeof(int[]).Assembly.FullName}"), typeof(int[]) },
16
{ TypeName.
Parse
(typeof(List<int>).AssemblyQualifiedName), typeof(List<int>) },
17
{ TypeName.
Parse
($"{typeof(List<int>).FullName}, {typeof(List<int>).Assembly.FullName}"), typeof(List<int>) },
18
{ TypeName.
Parse
(typeof(TestType).AssemblyQualifiedName), typeof(TestType) },
19
{ TypeName.
Parse
($"{typeof(TestType).FullName}, {typeof(TestType).Assembly.FullName}"), typeof(TestType) },
28
{ TypeName.
Parse
(typeof(int).AssemblyQualifiedName), typeof(int) },
29
{ TypeName.
Parse
(typeof(int[]).AssemblyQualifiedName), typeof(int[]) },
30
{ TypeName.
Parse
(typeof(List<int>).AssemblyQualifiedName), typeof(List<int>) },
31
{ TypeName.
Parse
(typeof(TestType).AssemblyQualifiedName), typeof(TestType) },
40
TypeName.
Parse
("System.Int32[], System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"),
41
TypeName.
Parse
("System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"),
42
TypeName.
Parse
("System.Int32, System.Private.CoreLib, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"),
43
TypeName.
Parse
($"System.Collections.Generic.List`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], {typeof(List<int>).Assembly.FullName}"),
44
TypeName.
Parse
($"{typeof(TestType).FullName}, {typeof(int).Assembly.FullName}")
55
{ TypeName.
Parse
(typeof(int).AssemblyQualifiedName), typeof(int) },
56
{ TypeName.
Parse
(typeof(int[]).AssemblyQualifiedName), typeof(int[]) },
57
{ TypeName.
Parse
(typeof(List<int>).AssemblyQualifiedName), typeof(List<int>) },
58
{ TypeName.
Parse
(typeof(TestType).AssemblyQualifiedName), typeof(TestType) },
69
{ TypeName.
Parse
(typeof(int).AssemblyQualifiedName), typeof(int) },
70
{ TypeName.
Parse
(typeof(int[]).AssemblyQualifiedName), typeof(int[]) },
71
{ TypeName.
Parse
(typeof(List<int>).AssemblyQualifiedName), typeof(List<int>) },
72
{ TypeName.
Parse
(typeof(TestType).AssemblyQualifiedName), typeof(TestType) },
75
TypeName name = TypeName.
Parse
(typeof(int).AssemblyQualifiedName);
78
name = TypeName.
Parse
(testName);
88
comparer.Equals(null, TypeName.
Parse
(typeof(int).AssemblyQualifiedName)).Should().BeFalse();
89
comparer.Equals(TypeName.
Parse
(typeof(int).AssemblyQualifiedName), null).Should().BeFalse();
91
TypeName.
Parse
(typeof(int).AssemblyQualifiedName),
92
TypeName.
Parse
($"{typeof(int).FullName}, {typeof(int).Assembly.FullName}")).Should().BeTrue();
100
int hash = comparer.GetHashCode(TypeName.
Parse
(typeof(int).AssemblyQualifiedName));
101
comparer.GetHashCode(TypeName.
Parse
(typeof(int).AssemblyQualifiedName)).Should().Be(hash);
102
comparer.GetHashCode(TypeName.
Parse
($"{typeof(int).FullName}, {typeof(int).Assembly.FullName}")).Should().Be(hash);
107
{ TypeName.
Parse
("System.Int32"), typeof(int) },
108
{ TypeName.
Parse
("System.Int32[]"), typeof(int[]) },
109
{ TypeName.
Parse
("System.Collections.Generic.List`1[[System.Int32]]"), typeof(List<int>) },
110
{ TypeName.
Parse
(typeof(TestType).FullName), typeof(TestType) },
121
{ TypeName.
Parse
(typeof(int).FullName), typeof(int) },
122
{ TypeName.
Parse
(typeof(int[]).FullName), typeof(int[]) },
123
{ TypeName.
Parse
(typeof(List<int>).FullName), typeof(List<int>) },
124
{ TypeName.
Parse
(typeof(TestType).FullName), typeof(TestType) },
133
TypeName.
Parse
("UnknownType"),
134
TypeName.
Parse
("List`1[[UnknownType]]"),
135
TypeName.
Parse
("Int32"),
136
TypeName.
Parse
("Int32[]"),
137
TypeName.
Parse
("System.Collections.Generic.List`1[[Int32]]"),
138
TypeName.
Parse
(nameof(TestType))
147
{ TypeName.
Parse
(typeof(int).FullName), typeof(int) },
148
{ TypeName.
Parse
(typeof(int[]).FullName), typeof(int[]) },
149
{ TypeName.
Parse
(typeof(List<int>).FullName), typeof(List<int>) },
150
{ TypeName.
Parse
(typeof(TestType).FullName), typeof(TestType) },
158
{ TypeName.
Parse
($"{typeof(int).FullName}, {typeof(int).Assembly.GetName().Name}"), typeof(int) },
159
{ TypeName.
Parse
($"{typeof(int[]).FullName}, {typeof(int).Assembly.GetName().Name}"), typeof(int[]) },
160
{ TypeName.
Parse
($"{typeof(List<int>).FullName}, {typeof(List<int>).Assembly.GetName().Name}"), typeof(List<int>) },
161
{ TypeName.
Parse
($"{typeof(TestType).FullName}, {typeof(TestType).Assembly.GetName().Name}"), typeof(TestType) },
171
{ TypeName.
Parse
($"{typeof(int).FullName}, {typeof(int).Assembly.GetName().Name}"), typeof(int) },
172
{ TypeName.
Parse
($"{typeof(int[]).FullName}, {typeof(int).Assembly.GetName().Name}"), typeof(int[]) },
173
{ TypeName.
Parse
($"{typeof(List<int>).FullName}, {typeof(List<int>).Assembly.GetName().Name}"), typeof(List<int>) },
174
{ TypeName.
Parse
($"{typeof(TestType).FullName}, {typeof(TestType).Assembly.GetName().Name}"), typeof(TestType) },
184
TypeName.
Parse
($"{typeof(int).FullName}, SomeOtherAssembly"),
186
TypeName.
Parse
($"SomeNamespace.SomeType, {typeof(int).Assembly.GetName().Name}"),
188
TypeName.
Parse
("SomeNamespace.SomeType, SomeOtherAssembly"),
190
TypeName.
Parse
($"{typeof(int).FullName}"),
192
TypeName.
Parse
($"System.String, {typeof(int).Assembly.GetName().Name}"),
202
{ TypeName.
Parse
($"{typeof(int).FullName}, {typeof(int).Assembly.GetName().Name}"), typeof(int) },
203
{ TypeName.
Parse
($"{typeof(int[]).FullName}, {typeof(int).Assembly.GetName().Name}"), typeof(int[]) },
204
{ TypeName.
Parse
($"{typeof(List<int>).FullName}, {typeof(List<int>).Assembly.GetName().Name}"), typeof(List<int>) },
205
{ TypeName.
Parse
($"{typeof(TestType).FullName}, {typeof(TestType).Assembly.GetName().Name}"), typeof(TestType) },
System\TypeExtensionsTests.cs (39)
14
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.All, true },
15
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.AllButAssemblyVersion, true },
16
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.TypeFullName, true },
17
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.AssemblyVersion, true },
18
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.AssemblyCultureName, true },
19
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.AssemblyName, true },
20
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.AssemblyPublicKeyToken, true },
21
{ typeof(int), TypeName.
Parse
($"System.Int32, {Assemblies.Mscorlib}"), (int)TypeNameComparison.AllButAssemblyVersion, false },
22
{ typeof(int), TypeName.
Parse
($"System.Int32, {Assemblies.Mscorlib}"), (int)TypeNameComparison.TypeFullName, true },
23
{ typeof(int), TypeName.
Parse
($"Int32, {Assemblies.Mscorlib}"), (int)TypeNameComparison.TypeFullName, false },
24
{ typeof(int?), TypeName.
Parse
(typeof(int).AssemblyQualifiedName), (int)TypeNameComparison.AllButAssemblyVersion, false },
25
{ typeof(int?), TypeName.
Parse
(typeof(int?).AssemblyQualifiedName), (int)TypeNameComparison.All, true },
26
{ typeof(int?[]), TypeName.
Parse
($"System.Nullable`1[[System.Int32, {Assemblies.Mscorlib}]][], {Assemblies.Mscorlib}"), (int)TypeNameComparison.AllButAssemblyVersion, false},
27
{ typeof(DayOfWeek), TypeName.
Parse
($"System.Nullable`1[[System.DayOfWeek, {Assemblies.Mscorlib}]], {Assemblies.Mscorlib}"), (int)TypeNameComparison.AllButAssemblyVersion, false },
29
{ typeof(int), TypeName.
Parse
(typeof(int).AssemblyQualifiedName!.Replace("neutral", "en-US")), (int)TypeNameComparison.AssemblyCultureName, false },
31
{ typeof(int), TypeName.
Parse
("Int32"), (int)TypeNameComparison.TypeFullName, false },
33
{ typeof(int), TypeName.
Parse
("SYSTEM.Int32"), (int)TypeNameComparison.TypeFullName, false },
35
{ typeof(int), TypeName.
Parse
("System.Int32"), (int)TypeNameComparison.AllButAssemblyVersion, false },
37
{ typeof(int), TypeName.
Parse
($"System.Int32, {typeof(int).Assembly.FullName!.ToUpperInvariant()}"), (int)TypeNameComparison.AssemblyName, false },
45
TypeName.
Parse
(type.AssemblyQualifiedName).Matches(typeName, (TypeNameComparison)comparison).Should().Be(matches);
54
TypeName.
Parse
(typeof(int).AssemblyQualifiedName!.Replace("7cec85d7bea7798e", "7cec00000ea7798e")),
61
{ TypeName.
Parse
($"System.Int32, {Assemblies.Mscorlib}"), TypeName.
Parse
($"System.Int32, {Assemblies.Mscorlib}"), true },
62
{ TypeName.
Parse
($"System.Int32, {Assemblies.Mscorlib}"), TypeName.
Parse
($"System.String, {Assemblies.Mscorlib}"), false },
63
{ TypeName.
Parse
($"System.Collections.Generic.Dictionary`2[[System.String, {Assemblies.Mscorlib}],[System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], {Assemblies.Mscorlib}"), TypeName.
Parse
($"System.Collections.Generic.Dictionary`2[[System.String, {Assemblies.Mscorlib}],[System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], {Assemblies.Mscorlib}"), true },
64
{ TypeName.
Parse
($"System.Collections.Generic.Dictionary`2[[System.String, {Assemblies.Mscorlib}],[System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], {Assemblies.Mscorlib}"), TypeName.
Parse
($"System.Collections.Generic.Dictionary`2[[System.String, {Assemblies.Mscorlib}],[System.Drawing.Bitmap, System.Drawing, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], {Assemblies.Mscorlib}"), false },
65
{ TypeName.
Parse
($"System.Collections.Generic.Dictionary`2[[System.String, {Assemblies.Mscorlib}],[System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], {Assemblies.Mscorlib}"), TypeName.
Parse
($"System.Collections.Generic.Dictionary`2[[System.String, {Assemblies.Mscorlib}],[System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], mscorlib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"), false },
66
{ TypeName.
Parse
($"System.Drawing.Bitmap[], System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), TypeName.
Parse
($"System.Drawing.Bitmap[], System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), true },
67
{ TypeName.
Parse
($"System.Drawing.Bitmap[], System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), TypeName.
Parse
($"System.Drawing.Bitmap[], System.Drawing, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), false },
68
{ TypeName.
Parse
($"System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), TypeName.
Parse
($"System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), true },
69
{ TypeName.
Parse
($"System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), TypeName.
Parse
($"System.Drawing.Bitmap, System.Drawing, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), false },
System.Windows.Forms.Tests (1)
System\Resources\ResXSerializationBinderTests.cs (1)
86
TypeName parsed = TypeName.
Parse
($"{typeof(Form).FullName}, {typeof(Form).Assembly.FullName}");