System.Xml.Serialization.XmlAnyElementAttributes.Add C# (CSharp) Method

Add() public method

public Add ( XmlAnyElementAttribute attribute ) : int
attribute XmlAnyElementAttribute
return int
        public int Add(XmlAnyElementAttribute attribute) {
            return List.Add(attribute);
        }
        

Usage Example

Example #1
0
        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;
            }
        }
All Usage Examples Of System.Xml.Serialization.XmlAnyElementAttributes::Add