Example #1
0
        internal static TypeErrorsBuilder CheckIndexers(this TypeErrorsBuilder typeErrors, Type type, MemberSettings settings)
        {
            var propertiesSettings = settings as PropertiesSettings;
            var propertyInfos      = type.GetProperties(settings.BindingFlags);

            foreach (var propertyInfo in propertyInfos)
            {
                if (propertyInfo.GetIndexParameters().Length == 0)
                {
                    continue;
                }

                if (propertiesSettings?.IsIgnoringProperty(propertyInfo) == true)
                {
                    continue;
                }

                if (settings.IsIgnoringDeclaringType(propertyInfo.DeclaringType))
                {
                    continue;
                }

                typeErrors = typeErrors.CreateIfNull(type)
                             .Add(UnsupportedIndexer.GetOrCreate(propertyInfo));
            }

            return(typeErrors);
        }