XmlSchemaObjectCollection.Add(XmlSchemaObject) 메서드


XmlSchemaObjectXmlSchemaObjectCollection을 추가합니다.Adds an XmlSchemaObject to the XmlSchemaObjectCollection.

 int Add(System::Xml::Schema::XmlSchemaObject ^ item);
public int Add (System.Xml.Schema.XmlSchemaObject item);
member this.Add : System.Xml.Schema.XmlSchemaObject -> int
Public Function Add (item As XmlSchemaObject) As Integer

매개 변수


항목에 추가한 인덱스입니다.The index at which the item has been added.


index가 0보다 작은 경우index is less than zero.

-또는--or- indexCount보다 큰 경우index is greater than Count.

지정된 XmlSchemaObject 매개 변수는 XmlSchemaExternal 형식 또는 파생된 XmlSchemaImport, XmlSchemaIncludeXmlSchemaRedefine 형식이 아닙니다.The XmlSchemaObject parameter specified is not of type XmlSchemaExternal or its derived types XmlSchemaImport, XmlSchemaInclude, and XmlSchemaRedefine.


Count 이미 용량과 같은 경우 내부 배열을 자동으로 재할당 하 고 새 요소를 추가 하기 전에 기존 요소를 새 배열에 복사 하 여 목록의 용량을 두 배로 증가 시킬 수 있습니다.If Count already equals the capacity, the capacity of list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

Count 용량 보다 작은 경우이 메서드는 0 (1) 연산입니다.If Count is less than the capacity, this method is an 0(1) operation. 새 요소를 수용할 수 있도록 용량을 늘려야 하는 경우이 메서드는 0 (n) 연산이 됩니다. 여기서 n은 Count입니다.If the capacity needs to be increased to accommodate the new element, this method becomes an 0(n) operation, where n is Count.

Add 메서드에는 XmlSchemaExternal 및 해당 파생 형식 (XmlSchemaImport, XmlSchemaIncludeXmlSchemaRedefine)만 매개 변수로 필요 합니다.The Add method expects only XmlSchemaExternal and its derived types (XmlSchemaImport, XmlSchemaInclude, and XmlSchemaRedefine) as parameters. 다음 예제에서는 기존 XmlSchema 개체의 Includes 컬렉션에 포함 된 스키마를 추가 하는 방법을 보여 줍니다.The following example illustrates adding an included schema to the Includes collection of an existing XmlSchema object.

Dim schema As XmlSchema = New XmlSchema()  
Dim textReader As XmlTextReader = New XmlTextReader("include.xsd")  
Dim includeSchema As XmlSchema = XmlSchema.Read(textReader, null)  
Dim include As XmlSchemaInclude = New XmlSchemaInclude()  
include.Schema = includeSchema;  
XmlSchema schema = new XmlSchema();  
XmlTextReader textReader = new XmlTextReader("include.xsd");  
XmlSchema includeSchema = XmlSchema.Read(textReader, null);  
XmlSchemaInclude include = new XmlSchemaInclude();  
include.Schema = includeSchema;  

적용 대상