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

◆ ImportAny()

ElementAccessor[] System.Xml.Serialization.XmlSchemaImporter.ImportAny ( XmlSchemaAny any,
bool makeElement,
string targetNamespace )
inlineprivate

Definition at line 1181 of file XmlSchemaImporter.cs.

1182 {
1183 SpecialMapping specialMapping = new SpecialMapping();
1184 specialMapping.TypeDesc = base.Scope.GetTypeDesc(makeElement ? typeof(XmlElement) : typeof(XmlNode));
1186 TypeFlags typeFlags = TypeFlags.CanBeElementValue;
1187 if (makeElement)
1188 {
1189 typeFlags |= TypeFlags.CanBeTextValue;
1190 }
1191 RunSchemaExtensions(specialMapping, XmlQualifiedName.Empty, null, any, typeFlags);
1192 if (GenerateOrder && any.Namespace != null)
1193 {
1194 NamespaceList namespaceList = new NamespaceList(any.Namespace, targetNamespace);
1195 if (namespaceList.Type == NamespaceList.ListType.Set)
1196 {
1197 ICollection enumerate = namespaceList.Enumerate;
1198 ElementAccessor[] array = new ElementAccessor[(enumerate.Count == 0) ? 1 : enumerate.Count];
1199 int num = 0;
1200 foreach (string item in namespaceList.Enumerate)
1201 {
1202 ElementAccessor elementAccessor = new ElementAccessor();
1204 elementAccessor.Any = true;
1206 array[num++] = elementAccessor;
1207 }
1208 if (num > 0)
1209 {
1210 return array;
1211 }
1212 }
1213 }
1214 ElementAccessor elementAccessor2 = new ElementAccessor();
1216 elementAccessor2.Any = true;
1217 return new ElementAccessor[1] { elementAccessor2 };
1218 }
void RunSchemaExtensions(TypeMapping mapping, XmlQualifiedName qname, XmlSchemaType type, XmlSchemaObject context, TypeFlags flags)

References System.array, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.XmlQualifiedName.Empty, System.Xml.Schema.NamespaceList.Enumerate, System.Xml.Serialization.XmlSchemaImporter.GenerateOrder, System.item, System.Xml.Serialization.XmlSchemaImporter.RunSchemaExtensions(), and System.Xml.Schema.NamespaceList.Type.

Referenced by System.Xml.Serialization.XmlSchemaImporter.GatherGroupChoices(), and System.Xml.Serialization.XmlSchemaImporter.ImportAnyMember().