Do I need to make an enum?
I want something like:
MyHardwareReport.Peripheral = ListOfPeripherals.Mouse
or
MyHardwareReport.Peripheral = ListOfPeripherals.Printer
How can I achieve something like this?
Do I need to make an enum?
I want something like:
MyHardwareReport.Peripheral = ListOfPeripherals.Mouse
or
MyHardwareReport.Peripheral = ListOfPeripherals.Printer
How can I achieve something like this?
Yes, an enum
is exactly what you need. General practice would be to name the enum
type after the class, rather than calling it a "ListOfSomething".
public enum Peripheral
{
Mouse,
Keyboard,
Printer
}