C # Program Design Notes (Chapter 8)

Source: Internet
Author: User
Chapter 8 Property Information
1. attribute information is a new feature of C. We can use attribute information to define design (such as document information), running (such as database Domain Name) information, or runtime behavior characteristics.
2. attribute information is mainly used to help code writing. You can also learn the developed classes and methods through attribute information.
3. to attach a defined property information to a C # type or member, you only need to specify the property information data in square brackets before the target type or member.
4. The carrier of the property information is the property information class. All the property information classes are derived directly or indirectly from the system. Attribute Class. Attribute is an abstract class. attribute information must inherit from the attribute class and implement its code.
5. to query additional property information about a type or member, you must use a reflection to dynamically determine the type feature of the application during running.
6. to query the additional features of a type or member, reflection is required ). Reflection dynamically determines the type and characteristics of an application at runtime.
7. positioning parameters are used in constructor parameters. They are necessary parameters each time you use features and need to be specified.
8. The name parameter is not defined in the feature constructor. More specifically, they are non-static fields and attributes.
9. When using the named parameters, you must first specify the positioning parameters. Since the named parameters are placed before the field names and attributes, there is no sequential order between the named parameters.
10. The types of positioning parameters and naming parameters of the feature class are limited to the feature parameter types.
11. You can use attributeusage to define features as single or multiple features. The last parameter of the attributeusageattribute attribute is its inherited mark, which can be used to mark whether the attribute can be inherited. Its default value is false.
12. The last parameter of the attributeusageattribute feature is its inherited mark, which indicates whether the feature can be inherited.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.