System.Xml.Serialization.SchemaObjectWriter.Write46_XmlSchemaElement C# (CSharp) Method

Write46_XmlSchemaElement() private method

private Write46_XmlSchemaElement ( XmlSchemaElement o ) : void
o System.Xml.Schema.XmlSchemaElement
return void
        void Write46_XmlSchemaElement(XmlSchemaElement o) {
            if ((object)o == null) return;
            System.Type t = o.GetType();
            WriteStartElement("element");
            WriteAttribute(@"id", @"", o.Id);
            WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
            WriteAttribute("maxOccurs", "", o.MaxOccurs == decimal.MaxValue ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
            if (((System.Boolean)o.@IsAbstract) != false) {
                WriteAttribute(@"abstract", @"", XmlConvert.ToString((System.Boolean)((System.Boolean)o.@IsAbstract)));
            }
            WriteAttribute(@"block", @"", Write11_XmlSchemaDerivationMethod(o.BlockResolved));
            WriteAttribute(@"default", @"", o.DefaultValue);
            WriteAttribute(@"final", @"", Write11_XmlSchemaDerivationMethod(o.FinalResolved));
            WriteAttribute(@"fixed", @"", o.FixedValue);
            if (o.Parent != null && !(o.Parent is XmlSchema)) {
                if (o.QualifiedName != null && !o.QualifiedName.IsEmpty && o.QualifiedName.Namespace != null && o.QualifiedName.Namespace.Length != 0) {
                    WriteAttribute(@"form", @"", "qualified");
                }
                else {
                    WriteAttribute(@"form", @"", "unqualified");
                }
            }
            if (o.Name != null && o.Name.Length != 0) {
                WriteAttribute(@"name", @"", o.Name);
            }
            if (o.IsNillable) {
                WriteAttribute(@"nillable", @"", XmlConvert.ToString(o.IsNillable));
            }
            if (!o.SubstitutionGroup.IsEmpty) {
                WriteAttribute("substitutionGroup", "", o.SubstitutionGroup);
            }
            if (!o.RefName.IsEmpty) {
                WriteAttribute("ref", "", o.RefName);
            }
            else if (!o.SchemaTypeName.IsEmpty) {
                WriteAttribute("type", "", o.SchemaTypeName);
            }
            
            WriteAttributes((XmlAttribute[])o.@UnhandledAttributes, o);
            Write5_XmlSchemaAnnotation(o.Annotation);
            if (o.SchemaType is XmlSchemaComplexType) {
                Write35_XmlSchemaComplexType((XmlSchemaComplexType)o.SchemaType);
            }
            else if (o.SchemaType is XmlSchemaSimpleType) {
                Write9_XmlSchemaSimpleType((XmlSchemaSimpleType)o.SchemaType);
            }
            WriteSortedItems(o.Constraints);
            WriteEndElement();
        }