Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
            private static bool TryEquals(UnsupportedIndexer x, UnsupportedIndexer y, out bool result)
            {
                if (x == null || y == null)
                {
                    result = false;
                    return(false);
                }

                result = x.Member == y.Member;
                return(true);
            }