XmlSchemaSet.CopyTo(XmlSchema[], Int32) Methode

Definition

Kopiert alle XmlSchema-Objekte aus dem XmlSchemaSet ab dem angegebenen Index in das angegebene Array.

public:
 void CopyTo(cli::array <System::Xml::Schema::XmlSchema ^> ^ schemas, int index);
public void CopyTo (System.Xml.Schema.XmlSchema[] schemas, int index);
member this.CopyTo : System.Xml.Schema.XmlSchema[] * int -> unit
Public Sub CopyTo (schemas As XmlSchema(), index As Integer)

Parameter

schemas
XmlSchema[]

Das Array, in das die Objekte kopiert werden sollen.

index
Int32

Der Index im Array, bei dem der Kopiervorgang beginnt.

Beispiele

Im folgenden Beispiel werden alle XmlSchema Objekte im XmlSchemaSet in ein Array von XmlSchema -Objekten kopiert.

Dim schemaSet As XmlSchemaSet = New XmlSchemaSet
schemaSet.Add("http://www.contoso.com/retail", "http://www.contoso.com/retail.xsd")
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd")
schemaSet.Add("http://www.contoso.com/music", "http://www.contoso.com/music.xsd")

Dim schemas(schemaSet.Count) As XmlSchema
schemaSet.CopyTo(schemas, 0)
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add("http://www.contoso.com/retail", "http://www.contoso.com/retail.xsd");
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd");
schemaSet.Add("http://www.contoso.com/music", "http://www.contoso.com/music.xsd");

XmlSchema[] schemas = new XmlSchema[schemaSet.Count];
schemaSet.CopyTo(schemas, 0);

Gilt für: