internal XmlSchema DeepClone()
{
XmlSchema schema = new XmlSchema {
attributeFormDefault = this.attributeFormDefault,
elementFormDefault = this.elementFormDefault,
blockDefault = this.blockDefault,
finalDefault = this.finalDefault,
targetNs = this.targetNs,
version = this.version,
isPreprocessed = this.isPreprocessed
};
for (int i = 0; i < this.items.Count; i++)
{
XmlSchemaObject obj2;
XmlSchemaComplexType type = this.items[i] as XmlSchemaComplexType;
if (type != null)
{
obj2 = type.Clone(this);
}
else
{
XmlSchemaElement element = this.items[i] as XmlSchemaElement;
if (element != null)
{
obj2 = element.Clone(this);
}
else
{
XmlSchemaGroup group = this.items[i] as XmlSchemaGroup;
if (group != null)
{
obj2 = group.Clone(this);
}
else
{
obj2 = this.items[i].Clone();
}
}
}
schema.Items.Add(obj2);
}
for (int j = 0; j < this.includes.Count; j++)
{
XmlSchemaExternal item = (XmlSchemaExternal)this.includes[j].Clone();
schema.Includes.Add(item);
}
schema.Namespaces = base.Namespaces;
schema.BaseUri = this.BaseUri;
return(schema);
}