2 using System.Reflection;
4 public class SimpleAttribute : Attribute {
8 public SimpleAttribute (string name)
14 [AttributeUsage (AttributeTargets.All)]
15 public class MineAttribute : Attribute {
16 public MineAttribute (params Type [] t)
23 [Mine(typeof(int), typeof (string), typeof(object[]))]
25 public static int MM ()
27 object[] attrs = typeof (Foo).GetCustomAttributes (typeof(MineAttribute), true);
28 MineAttribute ma = (MineAttribute) attrs [0];
29 if (ma.types [0] != typeof (int)){
30 Console.WriteLine ("failed");
33 if (ma.types [1] != typeof (string)){
34 Console.WriteLine ("failed");
37 if (ma.types [2] != typeof (object [])){
38 Console.WriteLine ("failed");
41 Console.WriteLine ("OK");
63 [Simple ((string) null)]
69 public static int Main ()
72 // We need a better test which does reflection to check if the
73 // attributes have actually been applied etc.