1 instantiation of EnumInfo
System.Private.CoreLib (1)
src\System\Enum.CoreCLR.cs (1)
120return new EnumInfo<TStorage>(hasFlagsAttribute, values, names!);
21 references to EnumInfo
System.Private.CoreLib (21)
src\libraries\System.Private.CoreLib\src\System\Enum.cs (11)
163private static string? GetName<TStorage>(EnumInfo<TStorage> enumInfo, TStorage value) 167/// <summary>Look up the name for the specified underlying value using the cached <see cref="EnumInfo{TStorage}"/> for the associated enum.</summary> 169/// <param name="enumInfo">The cached <see cref="EnumInfo{TStorage}"/> for the enum type.</param> 173private static unsafe string? GetNameInlined<TStorage>(EnumInfo<TStorage> enumInfo, TStorage value) 495EnumInfo<TStorage> enumInfo = GetEnumInfo<TStorage>(enumType, getNames: false); 1049EnumInfo<TStorage> enumInfo = GetEnumInfo<TStorage>(enumType); 1471EnumInfo<TStorage> enumInfo = GetEnumInfo<TStorage>(enumType); 1505EnumInfo<TStorage> enumInfo = GetEnumInfo<TStorage>(enumType); 1862EnumInfo<TStorage> enumInfo = GetEnumInfo<TStorage>(enumType); 1928private static string? FormatFlagNames<TStorage>(EnumInfo<TStorage> enumInfo, TStorage resultValue) 1961private static bool TryFormatFlagNames<TStorage>(EnumInfo<TStorage> enumInfo, TStorage resultValue, Span<char> destination, out int charsWritten, ref bool isDestinationTooSmall)
src\System\Enum.CoreCLR.cs (10)
79private static EnumInfo<TStorage> GetEnumInfo<TStorage>(RuntimeType enumType, bool getNames = true) 87return enumType.FindCacheEntry<EnumInfo<TStorage>>() is {} info && (!getNames || info.Names is not null) ? 92static EnumInfo<TStorage> InitializeEnumInfo(RuntimeType enumType, bool getNames) 98? enumType.ReplaceCacheEntry(EnumInfo<TStorage>.Create(enumType, getNames: true)) 99: enumType.GetOrCreateCacheEntry<EnumInfo<TStorage>>(); 103internal sealed partial class EnumInfo<TStorage> : RuntimeType.IGenericCacheEntry<EnumInfo<TStorage>> 105public static EnumInfo<TStorage> Create(RuntimeType type, bool getNames) 123public static EnumInfo<TStorage> Create(RuntimeType type) => Create(type, getNames: false); 128public static ref EnumInfo<TStorage>? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) 129=> ref Unsafe.As<RuntimeType.IGenericCacheEntry?, EnumInfo<TStorage>?>(ref compositeEntry._enumInfo);