--------------------------------------------Custom Features---------------------------------------------------
The above phrase is saying that you can create a keyword to define our own rules?
The custom features in C # are placed on the above [custom attribute name (,)] to indicate that XXX uses this custom feature.
There is also a prefix that explains what kind of data the custom feature uses such as the class return value structure. Wait, wait, he'll judge himself. Usage [method: Custom characteristics (,)]
An attribute is just an instance of a type and all attributes inherit from System.Attribute
The constructor parameter of an attribute is that the positional parameter is required to be worn in the setting field or the parameter of the property is called named parameter is optional
For example [DllImport ("Ternel32", Charset=charset.auto,setlasterror=true)]
Define your own features
Open a namespace so that its attributes inherit from attribute and then the class name suffix is attribute public constructor access modifier more than one display constructor
If our custom feature points to the application on the enumeration, then add the custom attribute to the enumeration above.
Attributeusage[attributetarget.enum,inherited=false];
You can tell the compiler what type is applied to the type we define.
1> no specified type applies to all elements 2> applies to a target only once 3> can be inherited
2016-11-24 (C # Custom feature) (not finished)