March 2004
Intermediate to advanced
560 pages
26h 47m
English
public sealed class ConditionalAttribute : Attribute { // Constructors public ConditionalAttribute (string conditionString); // Properties public string ConditionString { get; } }
|
BA There is a common misconception with usage of this custom attribute. By applying the ConditionalAttribute on a method you indicate that calls to that method should be removed by the compiler if the conditionString is defined. However, the method body is always compiled into the assembly regardless of whether the conditionString is defined or not. BG This is another clever custom attribute, which works similarly to C-style preprocessor directives but in reverse. Calls to methods with this attribute are conditionally compiled into source code, depending ... |
Read now
Unlock full access