I have to map a Flags Enumeration to multiple combo boxes.
For example, the first 2 bits need to correspond to a combo box for screen contrast setting:
Bit 0 - 1: Contrast (0=Low / 1 = Medium / 2=high)
Bits 2 & 3 need to correspond to the speech volume
Bit 2 - 3: Speech volume (0=Low / 1 = Medium / 2 = High)
and bits 4 & 5 correspond to the Buzzer volume.
Bit 4 – 5: Buzzer volume (0=Low / 1 = Medium / 2 = High)
Bit 6 corresponds to Entry or Exit (i.e. if it's on it's Entry, if it's off it's exit)
Bit 6: Entry/exit indication
My Flags enum is defined as:
[Flags]
public enum RKP
{
Contrast0 = 1, // bit 0
Contrast1 = 2, // bit 1
SpeechVolume2 = 4, // bit 2
SpeechVolume3 = 8, // bit 3
BuzzerVolume4 = 16, // bit 4
BuzzerVolume5 = 32, // bit 5
EntryExitIndication = 64, // bit 6
}
What's the best way to map these to the appropriate combo boxes, and then convert the values of each combo box to the correct enumeration value to save it?