private void Write64_XmlSchemaRedefine(string n, string ns, XmlSchemaRedefine o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && !(o.GetType() == typeof(XmlSchemaRedefine)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.EscapeName = false;
         base.WriteStartElement(n, ns, o, false, o.Namespaces);
         if (needType)
         {
             base.WriteXsiType("XmlSchemaRedefine", "http://www.w3.org/2001/XMLSchema");
         }
         base.WriteAttribute("schemaLocation", "", o.SchemaLocation);
         base.WriteAttribute("id", "", o.Id);
         XmlAttribute[] unhandledAttributes = o.UnhandledAttributes;
         if (unhandledAttributes != null)
         {
             for (int i = 0; i < unhandledAttributes.Length; i++)
             {
                 XmlAttribute node = unhandledAttributes[i];
                 base.WriteXmlAttribute(node, o);
             }
         }
         XmlSchemaObjectCollection items = o.Items;
         if (items != null)
         {
             for (int j = 0; j < items.Count; j++)
             {
                 XmlSchemaObject obj2 = items[j];
                 if (obj2 is XmlSchemaSimpleType)
                 {
                     this.Write34_XmlSchemaSimpleType("simpleType", "http://www.w3.org/2001/XMLSchema", (XmlSchemaSimpleType) obj2, false, false);
                 }
                 else if (obj2 is XmlSchemaComplexType)
                 {
                     this.Write62_XmlSchemaComplexType("complexType", "http://www.w3.org/2001/XMLSchema", (XmlSchemaComplexType) obj2, false, false);
                 }
                 else if (obj2 is XmlSchemaGroup)
                 {
                     this.Write63_XmlSchemaGroup("group", "http://www.w3.org/2001/XMLSchema", (XmlSchemaGroup) obj2, false, false);
                 }
                 else if (obj2 is XmlSchemaAttributeGroup)
                 {
                     this.Write40_XmlSchemaAttributeGroup("attributeGroup", "http://www.w3.org/2001/XMLSchema", (XmlSchemaAttributeGroup) obj2, false, false);
                 }
                 else if (obj2 is XmlSchemaAnnotation)
                 {
                     this.Write11_XmlSchemaAnnotation("annotation", "http://www.w3.org/2001/XMLSchema", (XmlSchemaAnnotation) obj2, false, false);
                 }
                 else if (obj2 != null)
                 {
                     throw base.CreateUnknownTypeException(obj2);
                 }
             }
         }
         base.WriteEndElement(o);
     }
 }