Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ImportElement() [2/2]

ElementAccessor System.Xml.Serialization.XmlSchemaImporter.ImportElement ( XmlSchemaElement element,
string identifier,
Type desiredMappingType,
Type baseType,
string ns,
bool topLevelElement )
inlineprivate

Definition at line 250 of file XmlSchemaImporter.cs.

251 {
252 if (!element.RefName.IsEmpty)
253 {
255 if (element.IsMultipleOccurrence && elementAccessor.Mapping is ArrayMapping)
256 {
257 ElementAccessor elementAccessor2 = elementAccessor.Clone();
260 return elementAccessor2;
261 }
262 return elementAccessor;
263 }
264 if (element.Name.Length == 0)
265 {
266 XmlQualifiedName parentName = XmlSchemas.GetParentName(element);
268 }
269 string identifier2 = Accessor.UnescapeName(element.Name);
270 identifier = ((identifier.Length != 0) ? (identifier + CodeIdentifier.MakePascal(identifier2)) : CodeIdentifier.MakeValid(identifier2));
272 ElementAccessor elementAccessor3 = new ElementAccessor();
274 elementAccessor3.Name = element.Name;
278 if (element.DefaultValue != null)
279 {
281 }
282 else if (element.FixedValue != null)
283 {
286 }
287 if (typeMapping is SpecialMapping && ((SpecialMapping)typeMapping).NamedAny)
288 {
290 }
292 if (topLevelElement)
293 {
295 }
296 else
297 {
298 elementAccessor3.Form = ElementForm(ns, element);
299 }
300 return elementAccessor3;
301 }
static string XmlElementHasNoName
Definition SR.cs:1482
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
TypeMapping ImportElementType(XmlSchemaElement element, string identifier, Type desiredMappingType, Type baseType, string ns)
ElementAccessor ImportElement(XmlQualifiedName name, Type desiredMappingType, Type baseType)
XmlSchemaForm ElementForm(string ns, XmlSchemaElement element)

References System.Xml.Schema.XmlSchemaElement.DefaultValue, System.Xml.Dictionary, System.Xml.Serialization.XmlSchemaImporter.ElementForm(), System.Xml.Schema.XmlSchemaElement.FixedValue, System.SR.Format(), System.Xml.Serialization.XmlSchemas.GetParentName(), System.Xml.Serialization.XmlSchemaImporter.ImportElement(), System.Xml.Serialization.XmlSchemaImporter.ImportElementType(), System.Xml.XmlQualifiedName.IsEmpty, System.Xml.Schema.XmlSchemaParticle.IsMultipleOccurrence, System.Xml.Schema.XmlSchemaElement.IsNillable, System.Xml.Serialization.CodeIdentifier.MakePascal(), System.Xml.Serialization.CodeIdentifier.MakeValid(), System.Xml.Schema.XmlSchemaElement.Name, System.Xml.Schema.XmlSchemaElement.RefName, System.Xml.Serialization.Accessor.UnescapeName(), and System.SR.XmlElementHasNoName.