2010-03-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / corlib / System / MonoType.cs
index c121286c15c3f7d9453ce1f4501aa9421bba1439..d4a19182c9ef0394ff6cfe36e10c15557d922bc7 100644 (file)
@@ -30,6 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Collections.Generic;
 using System.Globalization;
 using System.Reflection;
 using System.Runtime.CompilerServices;
@@ -684,6 +685,20 @@ namespace System
                        return res;
                }
 
+#if NET_4_0
+               public override IList<CustomAttributeData> GetCustomAttributesData () {
+                       return CustomAttributeData.GetCustomAttributes (this);
+               }
+
+
+               public override Array GetEnumValues () {
+                       if (!IsEnum)
+                               throw new ArgumentException ("Type is not an enumeration", "enumType");
+
+                       return Enum.GetValues (this);
+               }
+#endif
+
                static MethodBase CheckMethodSecurity (MethodBase mb)
                {
 #if NET_2_1
@@ -720,5 +735,27 @@ namespace System
                        newArgs [parameters.Length - 1] = paramArray;
                        args = newArgs;
                }
+
+#if NET_4_0
+               //seclevel { transparent = 0, safe-critical = 1, critical = 2}
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern int get_core_clr_security_level ();
+
+               public override bool IsSecurityTransparent
+               {
+                       get { return get_core_clr_security_level () == 0; }
+               }
+
+               public override bool IsSecurityCritical
+               {
+                       get { return get_core_clr_security_level () > 0; }
+               }
+
+               public override bool IsSecuritySafeCritical
+               {
+                       get { return get_core_clr_security_level () == 1; }
+               }
+#endif
+
        }
 }