Copied remotely
[mono.git] / mcs / tests / test-253.cs
1 using System; 
2 using System.Reflection; 
3  
4 [AttributeUsage(AttributeTargets.Field)]
5 public class AccessibleAttribute:Attribute {} 
6  
7 public class MyClass 
8
9         [Accessible]
10         public const int MyConst = 1; 
11
12  
13  
14 public class Test 
15
16     public static int Main() 
17     { 
18         FieldInfo fieldInfo = typeof(MyClass).GetField("MyConst", 
19             BindingFlags.Static | BindingFlags.Public); 
20  
21         AccessibleAttribute[] attributes = 
22           fieldInfo.GetCustomAttributes( 
23             typeof(AccessibleAttribute), true) as AccessibleAttribute[]; 
24         
25         if (attributes != null)
26         {
27                 Console.WriteLine ("Succeeded");
28                 return 0;
29         }
30         return 1;        
31     } 
32 }