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

◆ ExportAnyType() [2/2]

string? System.Xml.Serialization.XmlSchemaExporter.ExportAnyType ( XmlMembersMapping members)
inline

Definition at line 172 of file XmlSchemaExporter.cs.

173 {
174 if (members.Count == 1 && members[0].Any && members[0].ElementName.Length == 0)
175 {
176 XmlMemberMapping xmlMemberMapping = members[0];
177 string @namespace = xmlMemberMapping.Namespace;
178 bool flag = xmlMemberMapping.Mapping.TypeDesc.IsArrayLike;
179 bool flag2 = ((flag && xmlMemberMapping.Mapping.TypeDesc.ArrayElementTypeDesc != null) ? xmlMemberMapping.Mapping.TypeDesc.ArrayElementTypeDesc.IsMixed : xmlMemberMapping.Mapping.TypeDesc.IsMixed);
180 if (flag2 && xmlMemberMapping.Mapping.TypeDesc.IsMixed)
181 {
182 flag = true;
183 }
184 string text = (flag2 ? "any" : (flag ? "anyElements" : "anyElement"));
185 string text2 = text;
186 int num = 0;
187 XmlSchema xmlSchema = _schemas[@namespace];
188 if (xmlSchema != null)
189 {
190 while (true)
191 {
192 XmlSchemaType xmlSchemaType = FindSchemaType(text2, xmlSchema.Items);
193 if (xmlSchemaType == null)
194 {
195 break;
196 }
197 if (IsAnyType(xmlSchemaType, flag2, flag))
198 {
199 return text2;
200 }
201 num++;
202 text2 = text + num.ToString(CultureInfo.InvariantCulture);
203 }
204 }
205 XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType();
206 xmlSchemaComplexType.Name = text2;
207 xmlSchemaComplexType.IsMixed = flag2;
208 XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
209 XmlSchemaAny xmlSchemaAny = new XmlSchemaAny();
210 xmlSchemaAny.MinOccurs = 0m;
211 if (flag)
212 {
213 xmlSchemaAny.MaxOccurs = decimal.MaxValue;
214 }
215 xmlSchemaSequence.Items.Add(xmlSchemaAny);
216 xmlSchemaComplexType.Particle = xmlSchemaSequence;
217 AddSchemaItem(xmlSchemaComplexType, @namespace, null);
218 return text2;
219 }
220 return null;
221 }
static CultureInfo InvariantCulture
override XmlSchemaObjectCollection Items
XmlSchemaObjectCollection Items
Definition XmlSchema.cs:174

References System.Xml.Schema.XmlSchemaObjectCollection.Add(), System.Xml.Serialization.TypeDesc.ArrayElementTypeDesc, System.Xml.Dictionary, System.Globalization.CultureInfo.InvariantCulture, System.Xml.Serialization.TypeDesc.IsArrayLike, System.Xml.Serialization.TypeDesc.IsMixed, System.Xml.Schema.XmlSchema.Items, System.Xml.Schema.XmlSchemaSequence.Items, System.Xml.Serialization.XmlMemberMapping.Mapping, System.text, and System.Xml.Serialization.AccessorMapping.TypeDesc.