135 references to CustomAttributeEncoding
System.Private.CoreLib (135)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeCustomAttributeData.cs (86)
164internal static CustomAttributeEncoding TypeToCustomAttributeEncoding(RuntimeType type) 167return CustomAttributeEncoding.Int32; 170return CustomAttributeEncoding.Enum; 173return CustomAttributeEncoding.String; 176return CustomAttributeEncoding.Type; 179return CustomAttributeEncoding.Object; 182return CustomAttributeEncoding.Array; 185return CustomAttributeEncoding.Char; 188return CustomAttributeEncoding.Boolean; 191return CustomAttributeEncoding.Byte; 194return CustomAttributeEncoding.SByte; 197return CustomAttributeEncoding.Int16; 200return CustomAttributeEncoding.UInt16; 203return CustomAttributeEncoding.UInt32; 206return CustomAttributeEncoding.Int64; 209return CustomAttributeEncoding.UInt64; 212return CustomAttributeEncoding.Float; 215return CustomAttributeEncoding.Double; 219return CustomAttributeEncoding.Object; 222return CustomAttributeEncoding.Object; 225return CustomAttributeEncoding.Object; 228return CustomAttributeEncoding.Undefined; 292CustomAttributeEncoding.Field, 300CustomAttributeEncoding.Property, 471&& p.EncodedArgument.CustomAttributeType.EncodedType != CustomAttributeEncoding.Undefined) 486&& p.EncodedArgument.CustomAttributeType.EncodedType != CustomAttributeEncoding.Undefined) 512private static Type CustomAttributeEncodingToType(CustomAttributeEncoding encodedType) 516CustomAttributeEncoding.Enum => typeof(Enum), 517CustomAttributeEncoding.Int32 => typeof(int), 518CustomAttributeEncoding.String => typeof(string), 519CustomAttributeEncoding.Type => typeof(Type), 520CustomAttributeEncoding.Array => typeof(Array), 521CustomAttributeEncoding.Char => typeof(char), 522CustomAttributeEncoding.Boolean => typeof(bool), 523CustomAttributeEncoding.SByte => typeof(sbyte), 524CustomAttributeEncoding.Byte => typeof(byte), 525CustomAttributeEncoding.Int16 => typeof(short), 526CustomAttributeEncoding.UInt16 => typeof(ushort), 527CustomAttributeEncoding.UInt32 => typeof(uint), 528CustomAttributeEncoding.Int64 => typeof(long), 529CustomAttributeEncoding.UInt64 => typeof(ulong), 530CustomAttributeEncoding.Float => typeof(float), 531CustomAttributeEncoding.Double => typeof(double), 532CustomAttributeEncoding.Object => typeof(object), 537private static object EncodedValueToRawValue(PrimitiveValue val, CustomAttributeEncoding encodedType) 541CustomAttributeEncoding.Boolean => (byte)val.Byte4 != 0, 542CustomAttributeEncoding.Char => (char)val.Byte4, 543CustomAttributeEncoding.Byte => (byte)val.Byte4, 544CustomAttributeEncoding.SByte => (sbyte)val.Byte4, 545CustomAttributeEncoding.Int16 => (short)val.Byte4, 546CustomAttributeEncoding.UInt16 => (ushort)val.Byte4, 547CustomAttributeEncoding.Int32 => val.Byte4, 548CustomAttributeEncoding.UInt32 => (uint)val.Byte4, 549CustomAttributeEncoding.Int64 => val.Byte8, 550CustomAttributeEncoding.UInt64 => (ulong)val.Byte8, 551CustomAttributeEncoding.Float => BitConverter.Int32BitsToSingle(val.Byte4), 552CustomAttributeEncoding.Double => BitConverter.Int64BitsToDouble(val.Byte8), 565CustomAttributeEncoding encodedType = encodedArg.CustomAttributeType.EncodedType; 567if (encodedType == CustomAttributeEncoding.Undefined) 570if (encodedType == CustomAttributeEncoding.Enum) 575else if (encodedType == CustomAttributeEncoding.String) 580else if (encodedType == CustomAttributeEncoding.Type) 593else if (encodedType == CustomAttributeEncoding.Array) 598if (encodedType == CustomAttributeEncoding.Enum) 793if (namedArgType.EncodedType != CustomAttributeEncoding.Object) 801if (argType.EncodedType is CustomAttributeEncoding.Array 802&& namedArgType.EncodedArrayType is not CustomAttributeEncoding.Object 816if (namedArgType.EncodedType is CustomAttributeEncoding.Enum 817|| (namedArgType.EncodedType is CustomAttributeEncoding.Array 818&& namedArgType.EncodedArrayType is CustomAttributeEncoding.Enum)) 859internal sealed class CustomAttributeNamedParameter(MemberInfo memberInfo, CustomAttributeEncoding fieldOrProperty, CustomAttributeType type) 863public CustomAttributeEncoding FieldOrProperty => fieldOrProperty; 870CustomAttributeEncoding encodedType, 871CustomAttributeEncoding encodedArrayType, 872CustomAttributeEncoding encodedEnumType, 884CustomAttributeEncoding encodedType = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding(parameterType); 885CustomAttributeEncoding encodedArrayType = CustomAttributeEncoding.Undefined; 886CustomAttributeEncoding encodedEnumType = CustomAttributeEncoding.Undefined; 889if (encodedType == CustomAttributeEncoding.Array) 895if (encodedType == CustomAttributeEncoding.Enum 896|| encodedArrayType == CustomAttributeEncoding.Enum) 908public CustomAttributeEncoding EncodedType { get; } 909public CustomAttributeEncoding EncodedEnumType { get; } 910public CustomAttributeEncoding EncodedArrayType { get; }
System\Reflection\RuntimeCustomAttributeData.NativeAot.cs (49)
105CustomAttributeEncoding encodedType = encodedArg.CustomAttributeType.EncodedType; 107if (encodedType == CustomAttributeEncoding.Undefined) 110if (encodedType == CustomAttributeEncoding.Enum) 117if (encodedType == CustomAttributeEncoding.String) 120if (encodedType == CustomAttributeEncoding.Type) 123if (encodedType == CustomAttributeEncoding.Array) 128CustomAttributeEncoding encodedElementType = encodedArg.CustomAttributeType.EncodedArrayType; 129Type elementType = encodedElementType == CustomAttributeEncoding.Enum ? 182CustomAttributeType attributeType = type.EncodedType is CustomAttributeEncoding.Object 263CustomAttributeEncoding.Undefined, 436HandleType.ConstantBooleanValue => CreateType(CustomAttributeEncoding.Boolean), 437HandleType.ConstantCharValue => CreateType(CustomAttributeEncoding.Char), 438HandleType.ConstantByteValue => CreateType(CustomAttributeEncoding.Byte), 439HandleType.ConstantSByteValue => CreateType(CustomAttributeEncoding.SByte), 440HandleType.ConstantInt16Value => CreateType(CustomAttributeEncoding.Int16), 441HandleType.ConstantUInt16Value => CreateType(CustomAttributeEncoding.UInt16), 442HandleType.ConstantInt32Value => CreateType(CustomAttributeEncoding.Int32), 443HandleType.ConstantUInt32Value => CreateType(CustomAttributeEncoding.UInt32), 444HandleType.ConstantInt64Value => CreateType(CustomAttributeEncoding.Int64), 445HandleType.ConstantUInt64Value => CreateType(CustomAttributeEncoding.UInt64), 446HandleType.ConstantSingleValue => CreateType(CustomAttributeEncoding.Float), 447HandleType.ConstantDoubleValue => CreateType(CustomAttributeEncoding.Double), 449HandleType.ConstantStringValue or HandleType.ConstantReferenceValue => CreateType(CustomAttributeEncoding.String), 450HandleType.TypeDefinition or HandleType.TypeReference or HandleType.TypeSpecification => CreateType(CustomAttributeEncoding.Type), 454HandleType.ConstantBooleanArray => CreateArrayType(CustomAttributeEncoding.Boolean), 455HandleType.ConstantCharArray => CreateArrayType(CustomAttributeEncoding.Char), 456HandleType.ConstantByteArray => CreateArrayType(CustomAttributeEncoding.Byte), 457HandleType.ConstantSByteArray => CreateArrayType(CustomAttributeEncoding.SByte), 458HandleType.ConstantInt16Array => CreateArrayType(CustomAttributeEncoding.Int16), 459HandleType.ConstantUInt16Array => CreateArrayType(CustomAttributeEncoding.UInt16), 460HandleType.ConstantInt32Array => CreateArrayType(CustomAttributeEncoding.Int32), 461HandleType.ConstantUInt32Array => CreateArrayType(CustomAttributeEncoding.UInt32), 462HandleType.ConstantInt64Array => CreateArrayType(CustomAttributeEncoding.Int64), 463HandleType.ConstantUInt64Array => CreateArrayType(CustomAttributeEncoding.UInt64), 464HandleType.ConstantSingleArray => CreateArrayType(CustomAttributeEncoding.Float), 465HandleType.ConstantDoubleArray => CreateArrayType(CustomAttributeEncoding.Double), 466HandleType.ConstantStringArray => CreateArrayType(CustomAttributeEncoding.String), 467HandleType.ConstantHandleArray => CreateArrayType(CustomAttributeEncoding.Object), 483CustomAttributeEncoding underlyingType = 486? new CustomAttributeType(CustomAttributeEncoding.Array, CustomAttributeEncoding.Enum, underlyingType, enumType) 487: new CustomAttributeType(CustomAttributeEncoding.Enum, CustomAttributeEncoding.Undefined, underlyingType, enumType); 490private static CustomAttributeType CreateType(CustomAttributeEncoding type) 493CustomAttributeEncoding.Undefined, 494CustomAttributeEncoding.Undefined, 497private static CustomAttributeType CreateArrayType(CustomAttributeEncoding elementType) 499CustomAttributeEncoding.Array, 501CustomAttributeEncoding.Undefined,