internal static void AddDefaultXmlType(XmlSchemaSet schemas, string localName, string ns)
        {
            XmlSchemaComplexType defaultXmlType = CreateAnyType();

            defaultXmlType.Name = localName;
            XmlSchema schema = SchemaHelper.GetSchema(ns, schemas);

            schema.Items.Add(defaultXmlType);
            schemas.Reprocess(schema);
        }
        private static void AddDefaultTypedDatasetType(XmlSchemaSet schemas, XmlSchema datasetSchema, string localName, string ns)
        {
            XmlSchemaComplexType type = new XmlSchemaComplexType
            {
                Name     = localName,
                Particle = new XmlSchemaSequence()
            };
            XmlSchemaAny any = new XmlSchemaAny
            {
                Namespace = (datasetSchema.TargetNamespace == null) ? string.Empty : datasetSchema.TargetNamespace
            };

            ((XmlSchemaSequence)type.Particle).Items.Add(any);
            schemas.Add(datasetSchema);
            XmlSchema schema = SchemaHelper.GetSchema(ns, schemas);

            schema.Items.Add(type);
            schemas.Reprocess(datasetSchema);
            schemas.Reprocess(schema);
        }
        private static void AddDefaultDatasetType(XmlSchemaSet schemas, string localName, string ns)
        {
            XmlSchemaComplexType type = new XmlSchemaComplexType
            {
                Name     = localName,
                Particle = new XmlSchemaSequence()
            };
            XmlSchemaElement schemaRefElement = new XmlSchemaElement
            {
                RefName = new XmlQualifiedName(Globals.SchemaLocalName, XmlSchema.Namespace)
            };

            ((XmlSchemaSequence)type.Particle).Items.Add(schemaRefElement);
            XmlSchemaAny any = new XmlSchemaAny();

            ((XmlSchemaSequence)type.Particle).Items.Add(any);
            XmlSchema schema = SchemaHelper.GetSchema(ns, schemas);

            schema.Items.Add(type);
            schemas.Reprocess(schema);
        }
 private XmlSchema GetSchema(string ns)
 {
     return(SchemaHelper.GetSchema(ns, Schemas));
 }