System.Xml.Schema.XmlSchemaObjectCollection.Clone C# (CSharp) Méthode

Clone() private méthode

private Clone ( ) : XmlSchemaObjectCollection
Résultat XmlSchemaObjectCollection
        internal XmlSchemaObjectCollection Clone() {
            XmlSchemaObjectCollection coll = new XmlSchemaObjectCollection();
            coll.Add(this);
            return coll;
        }

Usage Example

Exemple #1
0
        internal static XmlSchemaObjectCollection CloneAttributes(XmlSchemaObjectCollection attributes)
        {
            if (HasAttributeQNameRef(attributes))
            {
                XmlSchemaObjectCollection  newAttributes = attributes.Clone();
                XmlSchemaAttributeGroupRef?attributeGroupRef;
                XmlSchemaAttributeGroupRef newAttGroupRef;
                XmlSchemaObject            xso;
                XmlSchemaAttribute         att;

                for (int i = 0; i < attributes.Count; i++)
                {
                    xso = attributes[i];
                    attributeGroupRef = xso as XmlSchemaAttributeGroupRef;
                    if (attributeGroupRef != null)
                    {
                        newAttGroupRef         = (XmlSchemaAttributeGroupRef)attributeGroupRef.Clone();
                        newAttGroupRef.RefName = attributeGroupRef.RefName.Clone();
                        newAttributes[i]       = newAttGroupRef;
                    }
                    else
                    { //Its XmlSchemaAttribute
                        att = (xso as XmlSchemaAttribute) !;
                        if (!att.RefName.IsEmpty || !att.SchemaTypeName.IsEmpty)
                        {
                            newAttributes[i] = att.Clone();
                        }
                    }
                }
                return(newAttributes);
            }
            return(attributes);
        }
All Usage Examples Of System.Xml.Schema.XmlSchemaObjectCollection::Clone