Get the Enum value Description

后端 未结 3 1980
离开以前
离开以前 2020-12-18 07:10

I have my enumHelper class that contains these:

public static IList GetValues()
{
  IList list = new List();
  foreach (object val         


        
3条回答
  •  情话喂你
    2020-12-18 08:04

    Enum doesn't have a Description() method. The best you could do is have your enum implement an interface that has the Description() method. If you do that, then you can have

    public static BindingList> getBindingList()
    

    and then inside of that you can refer to

    T foo = ...?
    foo.Description(...);
    

提交回复
热议问题