I am working with a DevExpress enumeration that has the following structure:
public enum RecurrenceDay
{
Sunday = 1,
Monday = 2,
Tuesday = 4,
Wednesday = 8,
Thursday = 16,
Friday = 32,
Saturday = 64,
WeekendDays = Sunday | Saturday,
WorkDays = Monday | Tuesday | Wednesday | Thursday | Friday,
EveryDay = WeekendDays | WorkDays
}
If the User choose Sunday and Monday inside the DevExpress control, the value stored is 3 which is the Sum of Sunday(1) + Monday(2). My problem is the following, I need to know from a number which values have been chosen from the enumeration.
Example:
6 = []{ Monday, Tuesday };
Is this possible without creating a lookup table that contains all possible combinations?