GetMatchingPatternMethod() static private method

static private GetMatchingPatternMethod ( Type patternInterface, MethodInfo providerMethodInfo ) : MethodInfo
patternInterface System.Type
providerMethodInfo System.Reflection.MethodInfo
return System.Reflection.MethodInfo
        private string GetMethodErrorsMsg()
        {
            var methodsWithErrors = (from methodInfoHelper in _methods
                                     select methodInfoHelper.ProviderMethodInfo
                                     into providerMethodInfo
                                     where ProviderPatternMatcher.GetMatchingPatternMethod(_patternClientInterface, providerMethodInfo) == null
                                     select providerMethodInfo.Name)
                                    .ToList();

            if (methodsWithErrors.Count > 0)
            {
                return(string.Format("These methods from provider interface do not have matching methods in client-side pattern interface:\n{0}",
                                     string.Join(", ", methodsWithErrors)));
            }
            return(string.Empty);
        }
        public PatternClientInstanceInterceptor(CustomPatternSchemaBase schema, IUIAutomationPatternInstance patternInstance)
        {
            _patternInstance = patternInstance;
            _currentPropGetterNameToHelper = schema.Properties.ToDictionary(helper => string.Format("get_Current{0}", helper.Data.pProgrammaticName));
            _cachedPropGetterNameToHelper  = schema.Properties.ToDictionary(helper => string.Format("get_Cached{0}", helper.Data.pProgrammaticName));

            // helpers are aware about provider methods, we have to map them from client-side pattern methods
            _methodInfoToHelper = new Dictionary <MethodInfo, UiaMethodInfoHelper>();
            foreach (var methodInfoHelper in schema.Methods)
            {
                var providerInfo = methodInfoHelper.ProviderMethodInfo;
                if (providerInfo == null)
                {
                    continue;
                }

                var patternMethod = ProviderPatternMatcher.GetMatchingPatternMethod(schema.PatternClientInterface, providerInfo);
                if (patternMethod != null)
                {
                    _methodInfoToHelper[patternMethod] = methodInfoHelper;
                }
            }
        }