src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (42)
59RuntimeType rt = (RuntimeType)typeof(TEnum);
100internal static string? GetName(RuntimeType enumType, ulong uint64Value)
223RuntimeType rt = (RuntimeType)typeof(TEnum);
256internal static string[] GetNamesNoCopy(RuntimeType enumType)
292Array values = GetValuesAsUnderlyingTypeNoCopy((RuntimeType)typeof(TEnum));
339internal static Array GetValuesAsUnderlyingType(RuntimeType enumType)
369internal static Array GetValuesAsUnderlyingTypeNoCopy(RuntimeType enumType)
474RuntimeType rt = (RuntimeType)typeof(TEnum);
492internal static bool IsDefinedPrimitive<TStorage>(RuntimeType enumType, TStorage value)
723RuntimeType rt = ValidateRuntimeType(enumType);
774static bool TryParseRareTypes(RuntimeType rt, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, [NotNullWhen(true)] out long result)
891RuntimeType rt = (RuntimeType)typeof(TEnum);
915RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TUnderlying result)
973RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TUnderlying result)
1043private static bool TryParseByName<TStorage>(RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TStorage result)
1357RuntimeType enumType = (RuntimeType)GetType();
1374static string HandleRareTypes(RuntimeType enumType, ref byte rawData) =>
1405RuntimeType enumType = (RuntimeType)GetType();
1425static string HandleRareTypes(RuntimeType enumType, char formatChar, ref byte rawData) =>
1452private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData)
1464private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData)
1481private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData)
1494private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData)
1630RuntimeType rtType = ValidateRuntimeType(enumType);
1690RuntimeType enumType = (RuntimeType)GetType();
1750RuntimeType rt = (RuntimeType)typeof(TEnum);
1809RuntimeType rt = (RuntimeType)typeof(TEnum);
1857private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten)
1892private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format)
2126private static RuntimeType ValidateRuntimeType(Type enumType)
2130RuntimeType? rt = enumType as RuntimeType;
2148throw new ArgumentException(enumType is not RuntimeType ? SR.Arg_MustBeType : SR.Arg_MustBeEnum, nameof(enumType));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeCustomAttributeData.cs (85)
36internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeType target)
42PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
52PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
62PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
112PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
131internal static CustomAttributeEncoding TypeToCustomAttributeEncoding(RuntimeType type)
241m_ctorParams[i] = new CustomAttributeCtorParameter(new CustomAttributeType((RuntimeType)parameters[i].ParameterType));
260new CustomAttributeType((RuntimeType)fi.FieldType));
268new CustomAttributeType((RuntimeType)pi.PropertyType));
760enumTag = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)enumType.GetEnumUnderlyingType());
895public RuntimeType? GetTypeValue()
1135public CustomAttributeType(RuntimeType parameterType)
1145parameterType = (RuntimeType)parameterType.GetElementType()!;
1153encodedEnumType = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)Enum.GetUnderlyingType(parameterType));
1184RuntimeType? attributeFilterType, bool mustBeInheritable,
1203out RuntimeType attributeType))
1280GetPropertyOrFieldData(decoratedModule, ref blobStart, blobEnd, out string name, out bool isProperty, out RuntimeType? type, out object? value);
1288type = (RuntimeType)value.GetType();
1289if (type == typeof(RuntimeType))
1291type = (RuntimeType)typeof(Type);
1332private static object CreateCustomAttributeInstance(ResolutionScope module, RuntimeType type, IRuntimeMethodInfo ctor, ref IntPtr blob, IntPtr blobEnd, out int namedArgs)
1344RuntimeType[] argumentTypes = constructor.ArgumentTypes;
1379RuntimeType argumentType = argumentTypes[i];
1422ResolutionScope module, ref IntPtr blobStart, IntPtr blobEnd, out string name, out bool isProperty, out RuntimeType? type, out object? value)
1439RuntimeType declaredType = ReadAttributeType(ref parser, encoding, module);
1472private static CustomAttributeEncoding GetPrimitiveEncoding(RuntimeType type) =>
1474? (RuntimeType)type.GetEnumUnderlyingType()
1497private static object? ReadAttributeValue(ref CustomAttributeEncodedArgument.CustomAttributeDataParser parser, RuntimeType type, ResolutionScope module)
1528RuntimeType valueType = ReadAttributeType(ref parser, parser.GetTag(), module);
1534return ReadAttributeArray(ref parser, (RuntimeType)type.GetElementType()!, module);
1544private static RuntimeType ReadAttributeType(
1549return (RuntimeType)CustomAttributeTypedArgument.CustomAttributeEncodingToType(encoding);
1554RuntimeType? enumType = ReadAttributeTypeName(ref parser, module);
1564RuntimeType elementType = ReadAttributeType(ref parser, parser.GetTag(), module, allowArray: false);
1565return (RuntimeType)elementType.MakeArrayType();
1571private static RuntimeType? ReadAttributeTypeName(ref CustomAttributeEncodedArgument.CustomAttributeDataParser parser, ResolutionScope module)
1618private static Array? ReadAttributeArray(ref CustomAttributeEncodedArgument.CustomAttributeDataParser parser, RuntimeType elementType, ResolutionScope module)
1676internal static bool IsDefined(RuntimeType type, RuntimeType? caType, bool inherit)
1692type = (type.BaseType as RuntimeType)!;
1699type = (type.BaseType as RuntimeType)!;
1705internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType, bool inherit)
1732internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType)
1742internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType)
1752internal static bool IsDefined(RuntimeEventInfo e, RuntimeType caType)
1762internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
1773internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
1784internal static bool IsDefined(RuntimeAssembly assembly, RuntimeType caType)
1793internal static bool IsDefined(RuntimeModule module, RuntimeType caType)
1803internal static object[] GetCustomAttributes(RuntimeType type, RuntimeType caType, bool inherit)
1812type = (type.GetGenericTypeDefinition() as RuntimeType)!;
1837type = (type.BaseType as RuntimeType)!;
1838} while (type != (RuntimeType)typeof(object) && type != null);
1848internal static object[] GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, bool inherit)
1890internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType)
1900internal static object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)
1910internal static object[] GetCustomAttributes(RuntimeEventInfo e, RuntimeType caType)
1920internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
1932internal static object[] GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType)
1944internal static object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
1954internal static object[] GetCustomAttributes(RuntimeModule module, RuntimeType caType)
1966int pcaCount, RuntimeType attributeFilterType)
1980private static bool MatchesTypeFilter(RuntimeType attributeType, RuntimeType attributeFilterType)
1984for (RuntimeType? type = attributeType; type != null; type = (RuntimeType?)type.BaseType)
1997RuntimeType attributeType, bool mustBeInheritable, ref ListBuilder<object> derivedAttributes)
2032internal static AttributeUsageAttribute GetAttributeUsage(RuntimeType decoratedAttribute)
2072internal static object[] CreateAttributeArrayHelper(RuntimeType caType, int elementCount)
2121private static readonly HashSet<RuntimeType> s_pca = CreatePseudoCustomAttributeHashSet();
2125private static HashSet<RuntimeType> CreatePseudoCustomAttributeHashSet()
2143HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length);
2144foreach (RuntimeType runtimeType in pcas)
2157internal static void GetCustomAttributes(RuntimeType type, RuntimeType caType, ref ListBuilder<Attribute> pcas)
2179internal static bool IsDefined(RuntimeType type, RuntimeType? caType)
2201internal static void GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, ref ListBuilder<Attribute> pcas)
2224internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType? caType)
2247internal static void GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType, ref ListBuilder<Attribute> pcas)
2280internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType? caType)
2309internal static void GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType, ref ListBuilder<Attribute> pcas)
2341internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType? caType)