XmlSchemaSet.CopyTo(XmlSchema[], Int32) XmlSchemaSet.CopyTo(XmlSchema[], Int32) XmlSchemaSet.CopyTo(XmlSchema[], Int32) XmlSchemaSet.CopyTo(XmlSchema[], Int32) Method

定义

XmlSchema 中的所有 XmlSchemaSet 对象复制到起始位置为给定索引的给定数组中。Copies all the XmlSchema objects from the XmlSchemaSet to the given array, starting at the given index.

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)

参数

schemas
XmlSchema[]

要向其复制对象的数组。The array to copy the objects to.

index
Int32 Int32 Int32 Int32

数组中开始复制处的索引。The index in the array where copying will begin.

示例

以下示例将复制所有XmlSchema中的对象XmlSchemaSet指向数组的XmlSchema对象。The following example copies all the XmlSchema objects in the XmlSchemaSet to an array of XmlSchema objects.

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);  

适用于