3 using System.Reflection;
6 public class MyAttribute: Attribute {
8 public MyAttribute (string stuff) {
9 System.Console.WriteLine (stuff);
15 static public int Main() {
16 System.Reflection.MemberInfo info = typeof (Test);
17 object[] attributes = info.GetCustomAttributes (false);
18 for (int i = 0; i < attributes.Length; i ++) {
19 System.Console.WriteLine(attributes[i]);
21 if (attributes.Length != 1)
23 MyAttribute attr = (MyAttribute) attributes [0];
24 if (attr.val != "testclass")