public sealed override bool HasSameMetadataDefinitionAs(MemberInfo other) => HasSameMetadataDefinitionAsCore<RuntimeFieldInfo>(other);
public override Module Module { get { return GetRuntimeModule(); } }
+ public override bool IsCollectible => m_declaringType.IsCollectible;
#endregion
#region Object Overrides
}
}
+ public override bool IsCollectible => RuntimeMethodHandle.GetIsCollectible(new RuntimeMethodHandleInternal(m_handle));
+
public override MethodInfo GetBaseDefinition()
{
if (!IsVirtual || IsStatic || m_declaringType == null || m_declaringType.IsInterface)
public override Module Module { get { return GetRuntimeModule(); } }
internal RuntimeModule GetRuntimeModule() { return m_declaringType.GetRuntimeModule(); }
+ public override bool IsCollectible => m_declaringType.IsCollectible;
#endregion
#region PropertyInfo Overrides
}
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool GetIsCollectible(RuntimeMethodHandleInternal handle);
+
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
internal static extern bool IsCAVisibleFromDecoratedType(
RuntimeTypeHandle attrTypeHandle,
IRuntimeMethodInfo attrCtor,
FCFuncElement("_GetCurrentMethod", RuntimeMethodHandle::GetCurrentMethod)
FCFuncElement("InvokeMethod", RuntimeMethodHandle::InvokeMethod)
QCFuncElement("GetFunctionPointer", RuntimeMethodHandle::GetFunctionPointer)
+ QCFuncElement("GetIsCollectible", RuntimeMethodHandle::GetIsCollectible)
FCFuncElement("GetImplAttributes", RuntimeMethodHandle::GetImplAttributes)
FCFuncElement("GetAttributes", RuntimeMethodHandle::GetAttributes)
FCFuncElement("GetDeclaringType", RuntimeMethodHandle::GetDeclaringType)
return funcPtr;
}
+
+BOOL QCALLTYPE RuntimeMethodHandle::GetIsCollectible(MethodDesc * pMethod)
+{
+ QCALL_CONTRACT;
+
+ BOOL isCollectible = FALSE;
+
+ BEGIN_QCALL;
+
+ isCollectible = pMethod->GetLoaderAllocator()->IsCollectible();
+
+ END_QCALL;
+
+ return isCollectible;
+}
FCIMPL1(LPCUTF8, RuntimeMethodHandle::GetUtf8Name, MethodDesc *pMethod) {
CONTRACTL {
static
void * QCALLTYPE GetFunctionPointer(MethodDesc * pMethod);
+ static BOOL QCALLTYPE GetIsCollectible(MethodDesc * pMethod);
+
static FCDECL1(INT32, GetAttributes, MethodDesc *pMethod);
static FCDECL1(INT32, GetImplAttributes, ReflectMethodObject *pMethodUNSAFE);
static FCDECL1(ReflectClassBaseObject*, GetDeclaringType, MethodDesc *pMethod);
public virtual IEnumerable<CustomAttributeData> CustomAttributes => GetCustomAttributesData();
public virtual IList<CustomAttributeData> GetCustomAttributesData() { throw NotImplemented.ByDesign; }
-
+ public virtual bool IsCollectible => true;
public virtual int MetadataToken { get { throw new InvalidOperationException(); } }
public override bool Equals(object obj) => base.Equals(obj);
public bool IsContextful => IsContextfulImpl();
protected virtual bool IsContextfulImpl() => false;
- public virtual bool IsCollectible => true;
-
public virtual bool IsEnum => IsSubclassOf(typeof(Enum));
public bool IsMarshalByRef => IsMarshalByRefImpl();
protected virtual bool IsMarshalByRefImpl() => false;