In your example code, DeviceType is not a
class
, it is an
enum
, so the variable
deviceType
is a
enum
as well (and isn't a reference at all, it's a ValueType)
You cannot add, store or otherwise include a string in an enum: it is a integer based variable type and cannot contain anythign else.
You could create a containing class which holds them both:
public class MyContainer
{
public DeviceType DeviceType { get; set; }
public string Text { get; set; }
}