Type.GetFields() - only returning “public const” fields

前端 未结 2 1831
渐次进展
渐次进展 2021-02-11 21:02

I want to call Type.GetFields() and only get back fields declared as \"public const\". I have this so far...

type.GetFields(BindingFlags.Static | BindingFlags.P         


        
2条回答
  •  灰色年华
    2021-02-11 21:30

    type.GetFields(BindingFlags.Static | BindingFlags.Public).Where(f => f.IsLiteral);
    

提交回复
热议问题