1 // Conditional attribute class test
5 using System
.Diagnostics
;
8 public class TestAttribute
: Attribute
{}
10 [Conditional("RELEASE")]
11 public class TestNotAttribute
: Attribute
{}
14 [Conditional("DEBUG")]
16 public class TestMultiAttribute
: Attribute
{}
18 // TestAttribute is included
22 // TestNotAttribute is not included
31 public class TestClass
33 public static int Main ()
35 if (Attribute
.GetCustomAttributes (typeof (Class1
)).Length
!= 1)
38 if (Attribute
.GetCustomAttributes (typeof (Class2
)).Length
!= 0)
41 if (Attribute
.GetCustomAttributes (typeof (Class3
)).Length
!= 1)
44 Console
.WriteLine ("OK");