2 using System
.Reflection
;
3 using System
.Diagnostics
;
5 namespace ConditionalAttributeTesting
9 public static int Main ()
15 public static int HelloWorld ()
17 var methodInfo
= MethodBase
.GetCurrentMethod ();
18 SomeAttribute someAttribute
= Attribute
.GetCustomAttribute (methodInfo
, typeof (SomeAttribute
)) as SomeAttribute
;
19 if (someAttribute
!= null) {
27 [AttributeUsage (AttributeTargets
.All
)]
28 [Conditional ("NOT_DEFINED")]
29 public abstract class BaseAttribute
: Attribute
33 public class SomeAttribute
: BaseAttribute
35 public SomeAttribute (string someText
)