Using GetHashCode for getting Enum int value

后端 未结 7 1226
北海茫月
北海茫月 2020-12-03 07:20

I have an enum

public enum INFLOW_SEARCH_ON
{
  ON_ENTITY_HANDLE = 0,         
  ON_LABEL = 1,                 
  ON_NODE_HANDLE = 2            
} // enum I         


        
7条回答
  •  悲&欢浪女
    2020-12-03 07:25

    You should use (int)MyEnumVariable for getting the literal value... you can also convert the other way like (INFLOW_SEARCH_ON)int

提交回复
热议问题