2 using System
.Reflection
;
4 [AttributeUsage (AttributeTargets
.All
)]
5 public class My
: Attribute
{
14 static public int Main() {
15 System
.Reflection
.MemberInfo info
= typeof (Test
);
16 object[] attributes
= info
.GetCustomAttributes (false);
17 for (int i
= 0; i
< attributes
.Length
; i
++) {
18 System
.Console
.WriteLine(attributes
[i
]);
20 if (attributes
.Length
!= 1)
22 My attr
= (My
) attributes
[0];
23 if ((TypeCode
) attr
.o
!= TypeCode
.Empty
)