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