System.Xml.Serialization.XmlSchemaExporter.ExportAnyType C# (CSharp) Méthode

ExportAnyType() public méthode

public ExportAnyType ( string ns ) : string
ns string
Résultat string
        public string ExportAnyType(string ns)
        {
            string name = "any";
            int i = 0;
            XmlSchema schema = _schemas[ns];
            if (schema != null)
            {
                while (true)
                {
                    XmlSchemaType schemaType = FindSchemaType(name, schema.Items);
                    if (schemaType == null)
                        break;
                    if (IsAnyType(schemaType, true, true))
                        return name;
                    i++;
                    name = "any" + i.ToString(CultureInfo.InvariantCulture);
                }
            }

            XmlSchemaComplexType type = new XmlSchemaComplexType();
            type.Name = name;
            type.IsMixed = true;
            XmlSchemaSequence seq = new XmlSchemaSequence();
            XmlSchemaAny any = new XmlSchemaAny();
            any.MinOccurs = 0;
            any.MaxOccurs = decimal.MaxValue;
            seq.Items.Add(any);
            type.Particle = seq;
            AddSchemaItem(type, ns, null);
            return name;
        }

Same methods

XmlSchemaExporter::ExportAnyType ( XmlMembersMapping members ) : string