O'Reilly logo

CLR via C#, 3rd 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 435

Defining Your Own Attribute Class 439

Attribute Constructor and Field/Property Data Types 443

Detecting the Use of a Custom Attribute 444

Matching Two Attribute Instances Against Each Other 448

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

Conditional Attribute Classes 454

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 ...

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