public XmlAttributes(ICustomAttributeProvider provider) { object[] attributes = provider.GetCustomAttributes(false); foreach (object obj in attributes) { if (obj is XmlAnyAttributeAttribute) { xmlAnyAttribute = (XmlAnyAttributeAttribute)obj; } else if (obj is XmlAnyElementAttribute) { xmlAnyElements.Add((XmlAnyElementAttribute)obj); } else if (obj is XmlArrayAttribute) { xmlArray = (XmlArrayAttribute)obj; } else if (obj is XmlArrayItemAttribute) { xmlArrayItems.Add((XmlArrayItemAttribute)obj); } else if (obj is XmlAttributeAttribute) { xmlAttribute = (XmlAttributeAttribute)obj; } else if (obj is XmlChoiceIdentifierAttribute) { xmlChoiceIdentifier = (XmlChoiceIdentifierAttribute)obj; } else if (obj is DefaultValueAttribute) { xmlDefaultValue = ((DefaultValueAttribute)obj).Value; } else if (obj is XmlElementAttribute) { xmlElements.Add((XmlElementAttribute )obj); } else if (obj is XmlEnumAttribute) { xmlEnum = (XmlEnumAttribute)obj; } else if (obj is XmlIgnoreAttribute) { xmlIgnore = true; } else if (obj is XmlNamespaceDeclarationsAttribute) { xmlns = true; } else if (obj is XmlRootAttribute) { xmlRoot = (XmlRootAttribute)obj; } else if (obj is XmlTextAttribute) { xmlText = (XmlTextAttribute)obj; } else if (obj is XmlTypeAttribute) { xmlType = (XmlTypeAttribute)obj; } } if (xmlIgnore) { xmlAnyAttribute = null; xmlAnyElements.Clear(); xmlArray = null; xmlArrayItems.Clear(); xmlAttribute = null; xmlChoiceIdentifier = null; xmlDefaultValue = null; xmlElements.Clear(); xmlEnum = null; xmlns = false; xmlRoot = null; xmlText = null; xmlType = null; } }