O'Reilly logo

CLR via C#, Fourth Edition by Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. Custom Attributes

In this chapter:

Using Custom Attributes

Defining Your Own Attribute Class

Attribute Constructor and Field/Property Data Types

Detecting the Use of a Custom Attribute

Matching Two Attribute Instances Against Each Other

Detecting the Use of a Custom Attribute Without Creating Attribute-Derived Objects

Conditional Attribute Classes

In this chapter, I’ll discuss one of the most innovative features the Microsoft .NET Framework has to offer: custom attributes. Custom attributes allow you to declaratively annotate your code constructs, thereby enabling special features. Custom attributes allow information to be defined and applied to almost any metadata table entry. This extensible metadata information can be queried at run time ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required