Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ExportElementAccessor()

void System.Xml.Serialization.XmlSchemaExporter.ExportElementAccessor ( XmlSchemaGroupBase group,
ElementAccessor accessor,
bool repeats,
bool valueTypeOptional,
string ns )
inlineprivate

Definition at line 844 of file XmlSchemaExporter.cs.

845 {
846 if (accessor.Any && accessor.Name.Length == 0)
847 {
851 if (accessor.Namespace != null && accessor.Namespace.Length > 0 && accessor.Namespace != ns)
852 {
854 }
855 group.Items.Add(xmlSchemaAny);
856 return;
857 }
859 int num = ((!(repeats || accessor.HasDefault || (!accessor.IsNullable && !accessor.Mapping.TypeDesc.IsValueType) || valueTypeOptional)) ? 1 : 0);
860 decimal maxOccurs = ((repeats || accessor.IsUnbounded) ? decimal.MaxValue : 1m);
861 if (xmlSchemaElement == null)
862 {
866 if (accessor.HasDefault)
867 {
869 }
870 if (accessor.IsTopLevelInSchema)
871 {
875 }
876 else
877 {
881 if (xmlSchema == null)
882 {
884 }
885 else
886 {
887 xmlSchemaElement.Form = ((accessor.Form != xmlSchema.ElementFormDefault) ? accessor.Form : XmlSchemaForm.None);
888 }
889 }
891 }
892 if (accessor.IsTopLevelInSchema)
893 {
895 xmlSchemaElement2.RefName = new XmlQualifiedName(accessor.Name, accessor.Namespace);
898 group.Items.Add(xmlSchemaElement2);
899 AddSchemaImport(accessor.Namespace, ns);
900 }
901 else
902 {
903 group.Items.Add(xmlSchemaElement);
904 }
905 }
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
void AddSchemaImport(string ns, string referencingNs)
static string ExportDefaultValue(TypeMapping mapping, object value)
void AddSchemaItem(XmlSchemaObject item, string ns, string referencingNs)
void ExportElementMapping(XmlSchemaElement element, Mapping mapping, string ns, bool isAny)

References System.Xml.Serialization.XmlSchemaExporter._elements, System.Xml.Serialization.XmlSchemaExporter._schemas, System.Collections.Hashtable.Add(), System.Xml.Serialization.XmlSchemaExporter.AddSchemaImport(), System.Xml.Serialization.XmlSchemaExporter.AddSchemaItem(), System.Xml.Dictionary, System.Xml.Serialization.XmlSchemaExporter.ExportDefaultValue(), and System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping().

Referenced by System.Xml.Serialization.XmlSchemaExporter.ExportElementAccessors().