I am writing a program in C#. The program controls a physical filter wheel which has interchangable wheels A through H. Each wheel can hold 8 filters. I want the user to be able to store friendly names for each filter in each wheel (64 total). The device and program are capable of identifying the wheel ID(A-H) and filter position (1-8) so what is the best way to store these 64 names and be able to reference them by the ID and POS. I could create a user setting for each one but there are two problems with that: 1) The names would not be the same for every user that logs onto the machine(i think), and 2) in order to access the specific names programmatically I have to use a HUGE case statement. Or is there a way to access settings by the name? like this..?
char WheelID = 'A';
int FilterPos = 4;
NewName = "FriendlyName";
string SettingIWant = WheelID.ToString() + FilterPos.ToString();
Properties.Settings[SettingIWant].Text = NewName;
Ok, I was just dumb and overlooked this way accessing the settings…
It works just fine. The only issue is the stored values won’t be the same for every user but they will just have to deal with that!