Playing with Enumerations
-
Hi guys! Maybe someone can help me with this: I have a library C which controls a device and it's methods take enumerations as parameters. Then I have a library B which references C and "wraps" the complex commands from library C in something useful and maintainable. The last thing I have is an assembly A which does the UI stuff. It references ONLY library B. Nevertheless B needs the values of the enumerations of C to control the device (and to fill comboboxes with the enum-Values) I need a way to pass the information, which value of an enumeration is needed from A to B. I do not want to reference C in A (that's how I would get the enumerations as well). Which would be a good approach to solve this problem. Help would really be appreciated!
-
Hi guys! Maybe someone can help me with this: I have a library C which controls a device and it's methods take enumerations as parameters. Then I have a library B which references C and "wraps" the complex commands from library C in something useful and maintainable. The last thing I have is an assembly A which does the UI stuff. It references ONLY library B. Nevertheless B needs the values of the enumerations of C to control the device (and to fill comboboxes with the enum-Values) I need a way to pass the information, which value of an enumeration is needed from A to B. I do not want to reference C in A (that's how I would get the enumerations as well). Which would be a good approach to solve this problem. Help would really be appreciated!
-
Hi guys! Maybe someone can help me with this: I have a library C which controls a device and it's methods take enumerations as parameters. Then I have a library B which references C and "wraps" the complex commands from library C in something useful and maintainable. The last thing I have is an assembly A which does the UI stuff. It references ONLY library B. Nevertheless B needs the values of the enumerations of C to control the device (and to fill comboboxes with the enum-Values) I need a way to pass the information, which value of an enumeration is needed from A to B. I do not want to reference C in A (that's how I would get the enumerations as well). Which would be a good approach to solve this problem. Help would really be appreciated!
Why not reference C in A? If B references C and A references B, then you have to distribute C with application A anyway. If you want A to have access to the values of the enumeration, referencing C is the 'right' and easiest way to go about it.
-
Hi guys! Maybe someone can help me with this: I have a library C which controls a device and it's methods take enumerations as parameters. Then I have a library B which references C and "wraps" the complex commands from library C in something useful and maintainable. The last thing I have is an assembly A which does the UI stuff. It references ONLY library B. Nevertheless B needs the values of the enumerations of C to control the device (and to fill comboboxes with the enum-Values) I need a way to pass the information, which value of an enumeration is needed from A to B. I do not want to reference C in A (that's how I would get the enumerations as well). Which would be a good approach to solve this problem. Help would really be appreciated!
I would put the enum in A; but you could put the enum in D.
-
I would put the enum in A; but you could put the enum in D.
-
Why not reference C in A? If B references C and A references B, then you have to distribute C with application A anyway. If you want A to have access to the values of the enumeration, referencing C is the 'right' and easiest way to go about it.
-
Thanks for the hint, unfortunately I can't do this due to he fact, that lib C wasn't written by me.
Then write your own in B, and then translate.