. Net has Attribute and Property, and Chinese translation is an Attribute, but they are very different. Attribute is often called a feature to distinguish.
Role of Attribute:
Attribute is similar to a label, and can be labeled for classes, methods, struct, attributes, and delegation. In the future, different labels are processed according to different labels.
Attribute features
1. Attribute is also a class
2. Attribute classes are instantiated during compilation, rather than being instantiated at runtime as a normal class.
An actual example is to control the behavior of the class through Attribute.
Defines a BlockAttribute. the specified range is a class, and the constructor is an enumeration type. The values are Yes and No.
Define some behavior classes that have the Say method to express what you want to Say.
To control what they say, you can add BlockAttribute tags to these classes to differentiate them.
Then, it controls channels, such as media and networks, to filter and filter.
Code: AttributeDemo.zip http://www.bkjia.com/uploadfile/2012/0320/20120320084204793.zip
JustRun1983
JustRun from JustRun1983