Nested Enum and Property Naming Conflicts

后端 未结 7 823
孤城傲影
孤城傲影 2021-02-06 23:48

There are some related questions here and here, but they didn\'t really give me satisfactory answers. The problem is that enums nested in a class in C# cannot have the same name

7条回答
  •  离开以前
    2021-02-07 00:12

    It't interesting to see that while the Microsoft Naming Guidelines say you should use a singular name for most enums and plural names for bit fields, the code sample for the enum keyword does use a plural name!

    enum Days { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday };
    

提交回复
热议问题