204 references to SerializationTypeCode
Microsoft.CodeAnalysis (101)
MetadataReader\MetadataDecoder.cs (51)
108
(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty,
SerializationTypeCode
typeCode,
SerializationTypeCode
elementTypeCode) DecodeCustomAttributeNamedArgumentOrThrow(ref BlobReader argReader);
1318
private void DecodeCustomAttributeFieldOrPropTypeOrThrow(ref BlobReader argReader, out
SerializationTypeCode
typeCode, out TypeSymbol type, out
SerializationTypeCode
elementTypeCode, out TypeSymbol elementType, bool isElementType)
1334
if (typeCode ==
SerializationTypeCode
.SZArray)
1342
SerializationTypeCode
unusedElementTypeCode;
1349
elementTypeCode =
SerializationTypeCode
.Invalid;
1354
case
SerializationTypeCode
.TaggedObject:
1358
case
SerializationTypeCode
.Enum:
1376
case
SerializationTypeCode
.Type:
1380
case
SerializationTypeCode
.String:
1381
case
SerializationTypeCode
.Boolean:
1382
case
SerializationTypeCode
.Char:
1383
case
SerializationTypeCode
.SByte:
1384
case
SerializationTypeCode
.Byte:
1385
case
SerializationTypeCode
.Int16:
1386
case
SerializationTypeCode
.UInt16:
1387
case
SerializationTypeCode
.Int32:
1388
case
SerializationTypeCode
.UInt32:
1389
case
SerializationTypeCode
.Int64:
1390
case
SerializationTypeCode
.UInt64:
1391
case
SerializationTypeCode
.Single:
1392
case
SerializationTypeCode
.Double:
1412
SerializationTypeCode
getTypeCode(ITypeSymbolInternal type)
1416
return
SerializationTypeCode
.Type;
1424
var
result = type.SpecialType.ToSerializationTypeOrInvalid();
1426
if (result ==
SerializationTypeCode
.Invalid)
1437
private TypedConstant DecodeCustomAttributeElementOrThrow(ref BlobReader argReader,
SerializationTypeCode
typeCode, TypeSymbol type)
1439
if (typeCode ==
SerializationTypeCode
.TaggedObject)
1442
SerializationTypeCode
elementTypeCode;
1446
if (typeCode ==
SerializationTypeCode
.SZArray)
1457
private TypedConstant DecodeCustomAttributeElementArrayOrThrow(ref BlobReader argReader,
SerializationTypeCode
elementTypeCode, TypeSymbol elementType, TypeSymbol arrayType)
1484
private TypedConstant DecodeCustomAttributePrimitiveElementOrThrow(ref BlobReader argReader,
SerializationTypeCode
typeCode, TypeSymbol type)
1490
case
SerializationTypeCode
.Boolean:
1493
case
SerializationTypeCode
.SByte:
1496
case
SerializationTypeCode
.Byte:
1499
case
SerializationTypeCode
.Int16:
1502
case
SerializationTypeCode
.UInt16:
1505
case
SerializationTypeCode
.Int32:
1508
case
SerializationTypeCode
.UInt32:
1511
case
SerializationTypeCode
.Int64:
1514
case
SerializationTypeCode
.UInt64:
1517
case
SerializationTypeCode
.Single:
1520
case
SerializationTypeCode
.Double:
1523
case
SerializationTypeCode
.Char:
1526
case
SerializationTypeCode
.String:
1534
case
SerializationTypeCode
.Type:
1554
public (KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty,
SerializationTypeCode
typeCode,
SerializationTypeCode
elementTypeCode) DecodeCustomAttributeNamedArgumentOrThrow(ref BlobReader argReader)
1567
SerializationTypeCode
typeCode, elementTypeCode;
1577
TypedConstant value = typeCode ==
SerializationTypeCode
.SZArray
MetadataReader\MetadataTypeCodeExtensions.cs (19)
129
internal static
SerializationTypeCode
ToSerializationType(this SpecialType specialType)
131
var
result = ToSerializationTypeOrInvalid(specialType);
133
if (result ==
SerializationTypeCode
.Invalid)
141
internal static
SerializationTypeCode
ToSerializationTypeOrInvalid(this SpecialType specialType)
146
return
SerializationTypeCode
.Boolean;
149
return
SerializationTypeCode
.SByte;
152
return
SerializationTypeCode
.Byte;
155
return
SerializationTypeCode
.Int16;
158
return
SerializationTypeCode
.Int32;
161
return
SerializationTypeCode
.Int64;
164
return
SerializationTypeCode
.UInt16;
167
return
SerializationTypeCode
.UInt32;
170
return
SerializationTypeCode
.UInt64;
173
return
SerializationTypeCode
.Single;
176
return
SerializationTypeCode
.Double;
179
return
SerializationTypeCode
.Char;
182
return
SerializationTypeCode
.String;
185
return
SerializationTypeCode
.TaggedObject;
188
return
SerializationTypeCode
.Invalid;
MetadataReader\PEModule.cs (10)
1319
if (typeCode ==
SerializationTypeCode
.String && isProperty && value.ValueInternal is string stringValue)
1359
(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty,
SerializationTypeCode
typeCode,
SerializationTypeCode
elementTypeCode) namedArgValues =
1362
if (namedArgValues is ({ Key: "IsOptional" }, isProperty: true, typeCode:
SerializationTypeCode
.Boolean, _))
1413
if (typeCode !=
SerializationTypeCode
.SZArray || elementTypeCode !=
SerializationTypeCode
.Type)
1517
(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty,
SerializationTypeCode
typeCode,
SerializationTypeCode
elementTypeCode) namedArgValues =
1520
if (namedArgValues is (_, isProperty: true, typeCode:
SerializationTypeCode
.Boolean, _))
2149
if (typeCode ==
SerializationTypeCode
.String && isProperty && value.ValueInternal is string stringValue)
Symbols\Attributes\AttributeDescription.cs (21)
94
public readonly
SerializationTypeCode
Underlying;
96
public TypeHandleTargetInfo(string @namespace, string name,
SerializationTypeCode
underlying)
113
new TypeHandleTargetInfo(system,"AttributeTargets",
SerializationTypeCode
.Int32)
114
,new TypeHandleTargetInfo("System.Reflection","AssemblyNameFlags",
SerializationTypeCode
.Int32)
115
,new TypeHandleTargetInfo(compilerServices,"MethodImplOptions",
SerializationTypeCode
.Int32)
116
,new TypeHandleTargetInfo(interopServices,"CharSet",
SerializationTypeCode
.Int32)
117
,new TypeHandleTargetInfo(interopServices,"LayoutKind",
SerializationTypeCode
.Int32)
118
,new TypeHandleTargetInfo(interopServices,"UnmanagedType",
SerializationTypeCode
.Int32)
119
,new TypeHandleTargetInfo(interopServices,"TypeLibTypeFlags",
SerializationTypeCode
.Int32)
120
,new TypeHandleTargetInfo(interopServices,"ClassInterfaceType",
SerializationTypeCode
.Int32)
121
,new TypeHandleTargetInfo(interopServices,"ComInterfaceType",
SerializationTypeCode
.Int32)
122
,new TypeHandleTargetInfo(compilerServices,"CompilationRelaxations",
SerializationTypeCode
.Int32)
123
,new TypeHandleTargetInfo("System.Diagnostics.DebuggableAttribute","DebuggingModes",
SerializationTypeCode
.Int32)
124
,new TypeHandleTargetInfo("System.Security","SecurityCriticalScope",
SerializationTypeCode
.Int32)
125
,new TypeHandleTargetInfo(interopServices,"CallingConvention",
SerializationTypeCode
.Int32)
126
,new TypeHandleTargetInfo("System.Configuration.Assemblies","AssemblyHashAlgorithm",
SerializationTypeCode
.Int32)
127
,new TypeHandleTargetInfo("System.EnterpriseServices","TransactionOption",
SerializationTypeCode
.Int32)
128
,new TypeHandleTargetInfo("System.Security.Permissions","SecurityAction",
SerializationTypeCode
.Int32)
129
,new TypeHandleTargetInfo(system,"Type",
SerializationTypeCode
.Type)
130
,new TypeHandleTargetInfo("Windows.Foundation.Metadata","DeprecationType",
SerializationTypeCode
.Int32)
131
,new TypeHandleTargetInfo("Windows.Foundation.Metadata","Platform",
SerializationTypeCode
.Int32)
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Attributes\SourceAttributeData.cs (1)
437
case (byte)
SerializationTypeCode
.Type:
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (19)
src\Compilers\Core\Portable\MetadataReader\MetadataTypeCodeExtensions.cs (19)
129
internal static
SerializationTypeCode
ToSerializationType(this SpecialType specialType)
131
var
result = ToSerializationTypeOrInvalid(specialType);
133
if (result ==
SerializationTypeCode
.Invalid)
141
internal static
SerializationTypeCode
ToSerializationTypeOrInvalid(this SpecialType specialType)
146
return
SerializationTypeCode
.Boolean;
149
return
SerializationTypeCode
.SByte;
152
return
SerializationTypeCode
.Byte;
155
return
SerializationTypeCode
.Int16;
158
return
SerializationTypeCode
.Int32;
161
return
SerializationTypeCode
.Int64;
164
return
SerializationTypeCode
.UInt16;
167
return
SerializationTypeCode
.UInt32;
170
return
SerializationTypeCode
.UInt64;
173
return
SerializationTypeCode
.Single;
176
return
SerializationTypeCode
.Double;
179
return
SerializationTypeCode
.Char;
182
return
SerializationTypeCode
.String;
185
return
SerializationTypeCode
.TaggedObject;
188
return
SerializationTypeCode
.Invalid;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Attributes\SourceAttributeData.vb (1)
252
Case CByte(
SerializationTypeCode
.Type)
System.Reflection.Emit (17)
System\Reflection\Emit\CustomAttributeWrapper.cs (17)
83
Type fieldType = dataType == EnumType ? typeof(int) : ElementTypeToType((
SerializationTypeCode
)dataType);
149
return DecodeCustomAttributeValue(ElementTypeToType((
SerializationTypeCode
)subtype), data, pos, out rpos);
157
private static Type ElementTypeToType(
SerializationTypeCode
elementType) =>
160
SerializationTypeCode
.Boolean => typeof(bool),
161
SerializationTypeCode
.Char => typeof(char),
162
SerializationTypeCode
.SByte => typeof(sbyte),
163
SerializationTypeCode
.Byte => typeof(byte),
164
SerializationTypeCode
.Int16 => typeof(short),
165
SerializationTypeCode
.UInt16 => typeof(ushort),
166
SerializationTypeCode
.Int32 => typeof(int),
167
SerializationTypeCode
.UInt32 => typeof(uint),
168
SerializationTypeCode
.Int64 => typeof(long),
169
SerializationTypeCode
.UInt64 => typeof(ulong),
170
SerializationTypeCode
.Single => typeof(float),
171
SerializationTypeCode
.Double => typeof(double),
172
SerializationTypeCode
.String => typeof(string),
173
SerializationTypeCode
.Type => typeof(string), // the type name written in string format
System.Reflection.Metadata (65)
System\Reflection\Metadata\BlobReader.cs (4)
543
/// <returns><see cref="
SerializationTypeCode
.Invalid"/> if the encoding is invalid.</returns>
544
public
SerializationTypeCode
ReadSerializationTypeCode()
549
return
SerializationTypeCode
.Invalid;
552
return unchecked((
SerializationTypeCode
)value);
System\Reflection\Metadata\Ecma335\CustomAttributeDecoder.cs (40)
150
public
SerializationTypeCode
TypeCode;
151
public
SerializationTypeCode
ElementTypeCode;
167
TypeCode = (
SerializationTypeCode
)signatureTypeCode,
189
info.TypeCode =
SerializationTypeCode
.TaggedObject;
197
info.TypeCode = _provider.IsSystemType(info.Type) ?
SerializationTypeCode
.Type : (
SerializationTypeCode
)_provider.GetUnderlyingEnumType(info.Type);
250
case
SerializationTypeCode
.Boolean:
251
case
SerializationTypeCode
.Byte:
252
case
SerializationTypeCode
.Char:
253
case
SerializationTypeCode
.Double:
254
case
SerializationTypeCode
.Int16:
255
case
SerializationTypeCode
.Int32:
256
case
SerializationTypeCode
.Int64:
257
case
SerializationTypeCode
.SByte:
258
case
SerializationTypeCode
.Single:
259
case
SerializationTypeCode
.String:
260
case
SerializationTypeCode
.UInt16:
261
case
SerializationTypeCode
.UInt32:
262
case
SerializationTypeCode
.UInt64:
266
case
SerializationTypeCode
.Type:
270
case
SerializationTypeCode
.TaggedObject:
274
case
SerializationTypeCode
.SZArray:
287
case
SerializationTypeCode
.Enum:
290
info.TypeCode = (
SerializationTypeCode
)_provider.GetUnderlyingEnumType(info.Type);
302
if (info.TypeCode ==
SerializationTypeCode
.TaggedObject)
312
case
SerializationTypeCode
.Boolean:
316
case
SerializationTypeCode
.Byte:
320
case
SerializationTypeCode
.Char:
324
case
SerializationTypeCode
.Double:
328
case
SerializationTypeCode
.Int16:
332
case
SerializationTypeCode
.Int32:
336
case
SerializationTypeCode
.Int64:
340
case
SerializationTypeCode
.SByte:
344
case
SerializationTypeCode
.Single:
348
case
SerializationTypeCode
.UInt16:
352
case
SerializationTypeCode
.UInt32:
356
case
SerializationTypeCode
.UInt64:
360
case
SerializationTypeCode
.String:
364
case
SerializationTypeCode
.Type:
369
case
SerializationTypeCode
.SZArray:
System\Reflection\Metadata\Ecma335\Encoding\BlobEncoders.cs (21)
784
Builder.WriteByte((byte)
SerializationTypeCode
.TaggedObject);
804
Builder.WriteByte((byte)
SerializationTypeCode
.SZArray);
805
Builder.WriteByte((byte)
SerializationTypeCode
.TaggedObject);
810
Builder.WriteByte((byte)
SerializationTypeCode
.SZArray);
824
private void WriteTypeCode(
SerializationTypeCode
value)
829
public void Boolean() => WriteTypeCode(
SerializationTypeCode
.Boolean);
830
public void Char() => WriteTypeCode(
SerializationTypeCode
.Char);
831
public void SByte() => WriteTypeCode(
SerializationTypeCode
.SByte);
832
public void Byte() => WriteTypeCode(
SerializationTypeCode
.Byte);
833
public void Int16() => WriteTypeCode(
SerializationTypeCode
.Int16);
834
public void UInt16() => WriteTypeCode(
SerializationTypeCode
.UInt16);
835
public void Int32() => WriteTypeCode(
SerializationTypeCode
.Int32);
836
public void UInt32() => WriteTypeCode(
SerializationTypeCode
.UInt32);
837
public void Int64() => WriteTypeCode(
SerializationTypeCode
.Int64);
838
public void UInt64() => WriteTypeCode(
SerializationTypeCode
.UInt64);
839
public void Single() => WriteTypeCode(
SerializationTypeCode
.Single);
840
public void Double() => WriteTypeCode(
SerializationTypeCode
.Double);
841
public void String() => WriteTypeCode(
SerializationTypeCode
.String);
860
WriteTypeCode((
SerializationTypeCode
)type);
871
WriteTypeCode(
SerializationTypeCode
.Type);
883
WriteTypeCode(
SerializationTypeCode
.Enum);