TextElementCollection<TextElementType>.InsertBefore(TextElementType, TextElementType) 方法

定义

将集合中的指定项插入到指定集合项之前。Inserts a specified item in the collection before a specified collection item.

public:
 void InsertBefore(TextElementType nextSibling, TextElementType newItem);
public void InsertBefore (TextElementType nextSibling, TextElementType newItem);
member this.InsertBefore : 'extElementType * 'extElementType -> unit
Public Sub InsertBefore (nextSibling As TextElementType, newItem As TextElementType)

参数

nextSibling
TextElementType

集合中在其前插入新项的项。An item in the collection before which the new item will be inserted.

newItem
TextElementType

要插入到集合的项。An item to insert into the collection.

例外

newItem 已属于集合时引发。Raised when newItem already belongs to a collection.

nextSibling 或 newItem 为 null 时引发。Raised when nextSibling or newItem is null.

nextSibling 不属于此集合时引发。Raised when nextSibling does not belong to this collection.

适用于