2010-03-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / corlib / System / MonoType.cs
index 8c7e26fb81fe0bd9e3c6d7b1037c312a5cb2c1e4..d4a19182c9ef0394ff6cfe36e10c15557d922bc7 100644 (file)
@@ -689,6 +689,14 @@ namespace System
                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)
@@ -727,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
+
        }
 }