System.Xml.Schema.XmlSchemaCollection.Add C# (CSharp) Method

Add() public method

public Add ( String ns, XmlReader reader ) : XmlSchema
ns String
reader System.Xml.XmlReader
return XmlSchema
        public XmlSchema Add(String ns, XmlReader reader)
        {
            return Add(ns, reader, _xmlResolver);
        }

Same methods

XmlSchemaCollection::Add ( String ns, XmlReader reader, XmlResolver resolver ) : XmlSchema
XmlSchemaCollection::Add ( XmlSchema schema ) : XmlSchema
XmlSchemaCollection::Add ( XmlSchema schema, XmlResolver resolver ) : XmlSchema
XmlSchemaCollection::Add ( string ns, SchemaInfo schemaInfo, XmlSchema schema, bool compile ) : XmlSchema
XmlSchemaCollection::Add ( string ns, SchemaInfo schemaInfo, XmlSchema schema, bool compile, XmlResolver resolver ) : XmlSchema
XmlSchemaCollection::Add ( string ns, string uri ) : XmlSchema
XmlSchemaCollection::Add ( XmlSchemaCollection schema ) : void
XmlSchemaCollection::Add ( string ns, XmlSchemaCollectionNode node ) : void

Usage Example

		public void TestAdd ()
		{
			XmlSchemaCollection col = new XmlSchemaCollection ();
			XmlSchema schema = new XmlSchema ();
			XmlSchemaElement elem = new XmlSchemaElement ();
			elem.Name = "foo";
			schema.Items.Add (elem);
			schema.TargetNamespace = "urn:foo";
			col.Add (schema);
			col.Add (schema);	// No problem !?

			XmlSchema schema2 = new XmlSchema ();
			schema2.Items.Add (elem);
			schema2.TargetNamespace = "urn:foo";
			col.Add (schema2);	// No problem !!

			schema.Compile (null);
			col.Add (schema);
			col.Add (schema);	// Still no problem !!!

			schema2.Compile (null);
			col.Add (schema2);

			schema = GetSchema ("Test/XmlFiles/xsd/3.xsd");
			schema.Compile (null);
			col.Add (schema);

			schema2 = GetSchema ("Test/XmlFiles/xsd/3.xsd");
			schema2.Compile (null);
			col.Add (schema2);
		}
All Usage Examples Of System.Xml.Schema.XmlSchemaCollection::Add