Platform.Xml.Serialization.SerializationMemberInfo.WalkApplicableAttributes C# (CSharp) Method

WalkApplicableAttributes() public method

public WalkApplicableAttributes ( bool includeTypeAttributes, bool includeAttributeSubclasses, Type types ) : System.Collections.Generic.IEnumerable
includeTypeAttributes bool
includeAttributeSubclasses bool
types System.Type
return System.Collections.Generic.IEnumerable
        public virtual System.Collections.Generic.IEnumerable<Attribute> WalkApplicableAttributes(bool includeTypeAttributes, bool includeAttributeSubclasses, Type[] types)
        {
            ArrayList list = new ArrayList();

            foreach (XmlSerializationAttribute attribute in applicableMemberAttributes)
            {
                foreach (Type type in types)
                {
                    if (type == attribute.GetType())
                    {
                        yield return attribute;
                    }
                    else if (includeAttributeSubclasses && type.IsInstanceOfType(attribute))
                    {
                        yield return attribute;
                    }
                }
            }

            if (includeTypeAttributes && applicableTypeAttributes != applicableMemberAttributes)
            {
                foreach (XmlSerializationAttribute attribute in applicableTypeAttributes)
                {
                    foreach (Type type in types)
                    {
                        if (type == attribute.GetType())
                        {
                            yield return attribute;
                        }
                        else if (includeAttributeSubclasses && type.IsInstanceOfType(attribute))
                        {
                            yield return attribute;
                        }
                    }
                }
            }
        }