TemplateGroupCollection.Remove(TemplateGroup) TemplateGroupCollection.Remove(TemplateGroup) TemplateGroupCollection.Remove(TemplateGroup) TemplateGroupCollection.Remove(TemplateGroup) Method


從集合中移除指定的 TemplateGroup 物件。Removes the specified TemplateGroup object from the collection.

 void Remove(System::Web::UI::Design::TemplateGroup ^ group);
public void Remove (System.Web.UI.Design.TemplateGroup group);
member this.Remove : System.Web.UI.Design.TemplateGroup -> unit
Public Sub Remove (group As TemplateGroup)


TemplateGroup TemplateGroup TemplateGroup TemplateGroup

要從集合中移除的 TemplateGroupThe TemplateGroup to remove from the collection.


方法會從集合中移除第一個出現的groupRemoveThe Remove method removes the first occurrence of group from the collection. 如果物件不包含group, 則集合會保持不變。 TemplateGroupCollectionIf the TemplateGroupCollection object does not contain group, the collection remains unchanged. 不會有例外狀況擲回。No exception is thrown.

方法會在TemplateGroup物件上Equals使用方法來判斷是否相等。 RemoveThe Remove method determines equality by using the Equals method on the TemplateGroup objects.

方法會執行線性搜尋; 因此, 平均執行時間會Count與屬性成正比。 RemoveThe Remove method performs a linear search; therefore, the average execution time is proportional to the Count property. 因為範本群組集合通常很小, 所以線性搜尋作業的效能並不重要。Because template group collections typically are small, the performance of the linear search operation is not critical.

若要從集合中移除特定索引處的群組, 請使用RemoveAt方法。To remove a group at a particular index from the collection, use the RemoveAt method. 若要從集合中移除所有群組, 請使用Clear方法。To remove all the groups from the collection, use the Clear method.


當您從集合中移除專案時, 索引會針對集合中的後續專案進行變更。When you remove an item from the collection, the indexes change for subsequent items in the collection.