TAILIEUCHUNG - Attributes and Reflection

Attributes are a simple technique for adding metadata information and behavior to code within applications. You use the reflection technique to pick the attribute related information at runtime. This chapter introduces attributes and reflection and the functions they perform in C# applications. This chapter discusses attribute syntax, and how to use some of the predefined attributes. This chapter discusses also discusses how to create customized user-defined attributes. In addition, this chapter discusses reflection and how to use it to extract attribute related information. . | Attributes and Reflection Chapter 13 Attributes are a simple technique for adding metadata information and behavior to code within applications. You use the reflection technique to pick the attribute related information at runtime. This chapter introduces attributes and reflection and the functions they perform in C applications. This chapter discusses attribute syntax and how to use some of the predefined attributes. This chapter discusses also discusses how to create customized user-defined attributes. In addition this chapter discusses reflection and how to use it to extract attribute related information. Objectives In this chapter you will learn to fl Describe attributes fl Retrieve metadata using reflection Introducing Attributes An object is described by the values of its attributes. For example a car can be described by its make model or color. Similarly a C program has certain attributes which depict and influence its behavior for example compiler instructions. An attribute is a declarative tag that is used to convey information to runtime about the behavior of programmatic elements such as classes enumerators and assemblies. A declarative tag is depicted by square brackets placed above the definition of an element such as a class or a method. Attributes are used for adding metadata such as compiler instructions and other information such as comments description methods and classes to a program. The .NET Framework is equipped with a number of predefined attributes. The code to examine the predefined attributes and act upon the values they contain is also incorporated as a part of the runtime and .NET Framework Software Development Kit SDK . Applying Attributes Attributes are applied to different elements of the code. These elements include assemblies modules classes structs enums constructors methods properties fields events interfaces parameters return values and delegates. Information about attributes is stored with the metadata of the elements they are .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.