System.Reflection.RuntimeMethodInfo.GetParentDefinition C# (CSharp) Method

GetParentDefinition() private method

private GetParentDefinition ( ) : MethodInfo
return MethodInfo
        internal override MethodInfo GetParentDefinition()
        {
            if (!IsVirtual || m_declaringType.IsInterface)
                return null;

            Type parent = m_declaringType.BaseType;

            if (parent == null)
                return null;

            int slot = m_handle.GetSlot();

            if (parent.GetTypeHandleInternal().GetNumVtableSlots() <= slot)
                return null;

            return(MethodInfo)RuntimeType.GetMethodBase(parent.GetTypeHandleInternal(), parent.GetTypeHandleInternal().GetMethodAt(slot));
        }

Usage Example

 internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType, bool inherit)
 {
     if (PseudoCustomAttribute.IsDefined(method, caType))
     {
         return(true);
     }
     if (CustomAttribute.IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType))
     {
         return(true);
     }
     if (!inherit)
     {
         return(false);
     }
     method = method.GetParentDefinition();
     while (method != null)
     {
         if (CustomAttribute.IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType, 0, inherit))
         {
             return(true);
         }
         method = method.GetParentDefinition();
     }
     return(false);
 }
All Usage Examples Of System.Reflection.RuntimeMethodInfo::GetParentDefinition