I have a class called Questions
(plural).
(我有一堂课,叫做Questions
(复数)。)
In this class there is an enum called Question
(singular) which looks like this. (在此类中,有一个名为Question
(单数)的枚举,它看起来像这样。)
public enum Question
{
Role = 2,
ProjectFunding = 3,
TotalEmployee = 4,
NumberOfServers = 5,
TopBusinessConcern = 6
}
In the Questions
class, I have a get(int foo)
function that returns a Questions
object for that foo
.
(在Questions
类中,我有一个get(int foo)
函数,该函数返回该foo
的Questions
对象。)
Is there an easy way to get the integer value from the enum so I can do something like Questions.Get(Question.Role)
? (有没有一种简单的方法可以从枚举中获取整数值,因此我可以执行Questions.Get(Question.Role)
?)
ask by jim translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…