}
}
+ public override Module Module {
+ get {
+ return GetRuntimeModule ();
+ }
+ }
+
RuntimeType ReflectedTypeInternal {
get {
return (RuntimeType) ReflectedType;
return sbName.ToString();
}
+ public override Delegate CreateDelegate (Type delegateType)
+ {
+ return Delegate.CreateDelegate (delegateType, this);
+ }
+
+ public override Delegate CreateDelegate (Type delegateType, object target)
+ {
+ return Delegate.CreateDelegate (delegateType, target, this);
+ }
+
public override String ToString()
{
return ReturnType.FormatTypeName() + " " + FormatNameAndSig(false);
}
+ internal RuntimeModule GetRuntimeModule ()
+ {
+ return ((RuntimeType)DeclaringType).GetRuntimeModule();
+ }
+
#region ISerializable Implementation
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
ParameterInfo[] pinfo = GetParametersInternal ();
ConvertValues (binder, parameters, pinfo, culture, invokeAttr);
-#if !NET_2_1
- if (SecurityManager.SecurityEnabled) {
- // sadly Attributes doesn't tell us which kind of security action this is so
- // we must do it the hard way - and it also means that we can skip calling
- // Attribute (which is another an icall)
- SecurityManager.ReflectedLinkDemandInvoke (this);
- }
-#endif
-
if (ContainsGenericParameters)
throw new InvalidOperationException ("Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.");
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern DllImportAttribute GetDllImportAttribute (IntPtr mhandle);
+ internal extern void GetPInvoke (out PInvokeAttributes flags, out string entryPoint, out string dllName);
internal object[] GetPseudoCustomAttributes ()
{
if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0)
attrs [count ++] = new PreserveSigAttribute ();
if ((info.attrs & MethodAttributes.PinvokeImpl) != 0) {
- DllImportAttribute attr = GetDllImportAttribute (mhandle);
- if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0)
- attr.PreserveSig = true;
- attrs [count ++] = attr;
+ attrs [count ++] = DllImportAttribute.GetCustomAttribute (this);
}
return attrs;
foreach (Type type in methodInstantiation) {
if (type == null)
throw new ArgumentNullException ();
- if (!(type is MonoType))
+ if (!(type is RuntimeType))
hasUserType = true;
}
return CustomAttributeData.GetCustomAttributes (this);
}
+#if MOBILE
+ static int get_core_clr_security_level ()
+ {
+ return 1;
+ }
+#else
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern int get_core_clr_security_level ();
+#endif
public override bool IsSecurityTransparent {
get { return get_core_clr_security_level () == 0; }
MonoMethod.ConvertValues (binder, parameters, pinfo, culture, invokeAttr);
-#if !NET_2_1
- if (SecurityManager.SecurityEnabled) {
- // sadly Attributes doesn't tell us which kind of security action this is so
- // we must do it the hard way - and it also means that we can skip calling
- // Attribute (which is another an icall)
- SecurityManager.ReflectedLinkDemandInvoke (this);
- }
-#endif
-
if (obj == null && DeclaringType.ContainsGenericParameters)
throw new MemberAccessException ("Cannot create an instance of " + DeclaringType + " because Type.ContainsGenericParameters is true.");
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
+
+#if MOBILE
+ static int get_core_clr_security_level ()
+ {
+ return 1;
+ }
+#else
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public extern int get_core_clr_security_level ();
+#endif
+
+ 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; }
+ }
}
}