namespace Test {
- [AttributeUsage (AttributeTargets.All)]
public class MyAttribute: Attribute {
public string val;
public MyAttribute (string stuff) {
}
}
- [AttributeUsage (AttributeTargets.All)]
public class My2Attribute: MyAttribute {
public int ival;
public My2Attribute (string stuff, int blah) : base (stuff) {
ival = blah;
}
}
+
+ [Flags, ]
+ enum X {
+ A, B
+ }
[My("testclass")]
[My2("testclass", 22)]
public class Test {
- static public int Main() {
+ public static int Main() {
System.Reflection.MemberInfo info = typeof (Test);
object[] attributes = info.GetCustomAttributes (false);
for (int i = 0; i < attributes.Length; i ++) {