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

GetBaseDefinition() public method

public GetBaseDefinition ( ) : MethodInfo
return MethodInfo
        public override MethodInfo GetBaseDefinition()
        {
            if (!IsVirtual || m_declaringType.IsInterface)
                return this;

            int slot = m_handle.GetSlot();
            RuntimeTypeHandle parent = m_handle.GetDeclaringType();
            RuntimeMethodHandle baseMethodHandle = RuntimeMethodHandle.EmptyHandle;
            do
            {
                int cVtblSlots = parent.GetNumVtableSlots();

                if (cVtblSlots <= slot)
                    break;

                baseMethodHandle = parent.GetMethodAt(slot);
                parent = baseMethodHandle.GetDeclaringType().GetBaseTypeHandle();
            } while(!parent.IsNullHandle());

            ASSERT.CONSISTENCY_CHECK((baseMethodHandle.GetAttributes() & MethodAttributes.Virtual) != 0);

            return(MethodInfo)RuntimeType.GetMethodBase(baseMethodHandle);
        }
        #endregion