Example #1
0
        /// <summary>
        /// Scan the type and its base types for an implementation of an interface method. Returns null if no
        /// implementation is found.
        /// </summary>
        public static MethodDesc ResolveInterfaceMethodTargetWithVariance(this TypeDesc thisType, MethodDesc interfaceMethodToResolve)
        {
            Debug.Assert(interfaceMethodToResolve.OwningType.IsInterface);

            MethodDesc result;
            TypeDesc   currentType = thisType;

            do
            {
                result      = currentType.ResolveVariantInterfaceMethodToVirtualMethodOnType(interfaceMethodToResolve);
                currentType = currentType.BaseType;
            }while (result == null && currentType != null);

            return(result);
        }