2 using System
.Reflection
;
5 [AttributeUsage (AttributeTargets
.All
, AllowMultiple
= true)]
6 public class My1Attribute
: Attribute
8 public My1Attribute (object o
)
11 throw new ApplicationException ();
15 public class My2Attribute
: Attribute
17 public My2Attribute (string[] s
)
20 throw new ApplicationException ();
24 public class My3Attribute
: Attribute
26 public My3Attribute (byte b
)
29 throw new ApplicationException ();
34 [My3(unchecked((byte)-1))]
39 public static int Main() {
40 System
.Reflection
.MemberInfo info
= typeof (Test
);
41 object[] attributes
= info
.GetCustomAttributes (false);
43 if (attributes
.Length
!= 4)
46 for (int i
= 0; i
< attributes
.Length
; i
++) {
47 Console
.WriteLine (attributes
[i
]);