public IEnumerable <EnumMemberInternal <TInt, TIntProvider> > GetMembers(EnumMemberSelection selection)
        {
            IEnumerable <EnumMemberInternal <TInt, TIntProvider> > members;

            switch (selection)
            {
            case EnumMemberSelection.All:
#if DISPLAY_ATTRIBUTE
            case EnumMemberSelection.DisplayOrder:
#endif
                members = _duplicateValues == null ? _valueMap.Values : GetMembersInternal();
                break;

            default:
                selection.Validate(nameof(selection));
                if (selection.HasAnyFlags(EnumMemberSelection.Flags))
                {
                    members = GetFlagMembers(AllFlags);
                }
                else if (selection.HasAnyFlags(EnumMemberSelection.Distinct))
                {
                    members = _valueMap.Values;
                }
                else
                {
                    return(null);
                }
                break;
            }

#if DISPLAY_ATTRIBUTE
            return(selection.HasAnyFlags(EnumMemberSelection.DisplayOrder)
                ? members.OrderBy(member => member.Attributes.Get <DisplayAttribute>()?.GetOrder() ?? int.MaxValue)
                : members);
#else
            return(members);
#endif
        }
        public int GetMemberCount(EnumMemberSelection selection)
        {
            switch (selection)
            {
            case EnumMemberSelection.All:
#if DISPLAY_ATTRIBUTE
            case EnumMemberSelection.DisplayOrder:
#endif
                return(_valueMap.Count + (_duplicateValues?.Count ?? 0));

            default:
                selection.Validate(nameof(selection));
                if (selection.HasAnyFlags(EnumMemberSelection.Flags))
                {
                    return(GetFlagCount());
                }
                if (selection.HasAnyFlags(EnumMemberSelection.Distinct))
                {
                    return(_valueMap.Count);
                }
                return(0);
            }
        }