Exemple #1
0
 public EnumMemberParser(EnumFormat format, [NotNull] EnumCache <TInt, TIntProvider> enumCache)
 {
     _formatValueMap =
         new Dictionary <string, EnumMember <TInt, TIntProvider> >(enumCache.GetMemberCount(EnumMemberSelection.All),
                                                                   StringComparer.Ordinal);
     foreach (EnumMember <TInt, TIntProvider> member in enumCache.GetMembers(EnumMemberSelection.All))
     {
         string formattedValue = member.AsString(format);
         if (formattedValue != null)
         {
             _formatValueMap[formattedValue] = member;
         }
     }
 }
Exemple #2
0
 public int GetCount(EnumMemberSelection selection)
 {
     return(_cache.GetMemberCount(selection));
 }