ServiceDescriptionCollection.Insert(Int32, ServiceDescription) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的 ServiceDescription 实例添加到 ServiceDescriptionCollection 从零开始的指定索引处。
public:
void Insert(int index, System::Web::Services::Description::ServiceDescription ^ serviceDescription);
public void Insert(int index, System.Web.Services.Description.ServiceDescription serviceDescription);
member this.Insert : int * System.Web.Services.Description.ServiceDescription -> unit
Public Sub Insert (index As Integer, serviceDescription As ServiceDescription)
参数
- index
- Int32
要插入参数的从零开始的 serviceDescription 索引。
- serviceDescription
- ServiceDescription
ServiceDescription要添加到集合中。
例外
示例
// Insert a ServiceDescription into the collection.
myCollection->Insert( 1, myServiceDescription2 );
// Insert a 'ServiceDescription' object into the collection.
myCollection.Insert(1, myServiceDescription2);
' Insert a 'ServiceDescription' object into the collection.
myCollection.Insert(1, myServiceDescription2)
注解
如果集合中的项数已等于集合的容量,则插入新元素之前,通过自动重新分配内部数组来增加容量。
index如果参数等于Count,则参数serviceDescription将添加到该ServiceDescriptionCollection参数的末尾。
插入点下移以容纳新元素的元素。