2 using System.Reflection;
8 static private int Main(string[] args)
10 Assembly assembly = Assembly.GetExecutingAssembly ();
11 Type type = assembly.GetType("MonoBug.Program", true);
12 MethodInfo info = type.GetMethod("Foo");
13 object[] attributes = info.GetCustomAttributes (false);
15 foreach (object obj in attributes)
17 Console.WriteLine("Attribute of type {0} found", obj.GetType().ToString());
20 return found == 1? 0: 1;
23 [My("blah", new string[] { "crash" }, "additional parameter")]
29 [AttributeUsage(AttributeTargets.Method)]
30 class MyAttribute : Attribute
32 public MyAttribute(params object[] arguments)