March 2004
Intermediate to advanced
560 pages
26h 47m
English
For brevity, the program only checks for the existence of one custom attibute, but for completeness, attributes are applied to most targets in the source code. The value AttributeTargets.All could also have been used in the following program instead of using individual values.
using System; using System.Reflection; [assembly: Samples.MyCustom] [module: Samples.MyCustom] namespace Samples { [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Module | AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue ...Read now
Unlock full access