For the following generic class.
class Message<T>
{
public enum TYPE { Heart, Spade };
}
In Java, to refer to enum, I can simply
// Works in Java
Message.TYPE type = Message.TYPE.Heart;
But how about in C#? In C#, I need to provide a dummy type
Message<double>.TYPE type = Message<double>.TYPE.Heart;
Is there any way I can avoid the dummy type?
You can use the following code.
and then you can access
TYPElikeMessage.TYPE type = Message.TYPE.Heart;