O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

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

Name

AttributeUsage Attribute

Class

System.AttributeUsageAttribute

Applies to

Class

Description

Defines the program elements to which a custom attribute can be applied. Its use is required when defining a custom attribute.

Constructor

New(validOn)
validOn (System.AttributeTargets)

Indicates the program elements to which a custom attribute can be applied. Possible values are All, Assembly, Class, Constructor, Delegate, Enum, Event, Field, Interface, Struct, Method, Module, Parameter, Property, and ReturnValue.

Properties

AllowMultiple (Boolean)

Indicates whether the attribute can be used more than once on a single program element. Its default value is False.

Inherited (Boolean)

Indicates whether attribute is automatically inherited by derived classes and overridden members. Its default value is True.

ValidOn (AttributeTargets enumeration)

Read-only. Indicates the program elements to which the attribute can be applied. Its value is set by the required validon parameter of the class constructor.

Example

See Section 8.2 in Chapter 8 for more details and an example.

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