2

I'm new to C#. I've encountered such syntax:

[Node (false, "Texture/Texture Split")]
public class TextureSplitNode : Node 
{
    ...
}

or another example from System.Type:

[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterfaceAttribute(typeof(_Type))]
[ComVisible(true)]
public abstract class Type : MemberInfo, IReflect, _Type
{
    ...
}

What do these preceding class declaration syntax constructions like [SomeType (someArg1, ..., someArgN)] means? Have they specific name?

user1234567
  • 3,991
  • 3
  • 19
  • 25
  • 4
    These are called as attributes in c#. Check this documentation :https://msdn.microsoft.com/en-us/library/aa288454(v=vs.71).aspx – Praburaj Jan 04 '17 at 10:37
  • 1
    This is an Attribute : http://stackoverflow.com/questions/9722303/what-do-square-braces-mean-when-placed-before-a-class-or-member-definition – Junior Porfirio Jan 04 '17 at 10:40

1 Answers1

1

They are called attributes. They add metadata information to the language element (e.g. class, method or parameter) they are applied to.

Metadata id non-executable information that describes the code.

Sefe
  • 13,731
  • 5
  • 42
  • 55