What are [..] called above enum / class definition?

This question already has an answer here:

  • What does the [Flags] Enum Attribute mean in C#? 10 answers
  • What does square bracket [] mean in the below code? 2 answers
  • what is [] brackets in .net? [duplicate] 7 answers

  • It's a class attribute. There are also method attributes for example.

    You can even write your own

    They are usually used to define meta information or behaviour about a class or method and can be read using reflection.

    链接地址: http://www.djcxy.com/p/54442.html

    上一篇: C#标志与示例枚举

    下一篇: 什么是[?]以上枚举/类定义?