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)
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
+
}
}