TemplateGroupCollection.IndexOf(TemplateGroup) TemplateGroupCollection.IndexOf(TemplateGroup) TemplateGroupCollection.IndexOf(TemplateGroup) TemplateGroupCollection.IndexOf(TemplateGroup) Method

定義

傳回指定的 TemplateGroup 物件在集合中的索引。Returns the index of the specified TemplateGroup object within the collection.

public:
 int IndexOf(System::Web::UI::Design::TemplateGroup ^ group);
public int IndexOf (System.Web.UI.Design.TemplateGroup group);
member this.IndexOf : System.Web.UI.Design.TemplateGroup -> int
Public Function IndexOf (group As TemplateGroup) As Integer

參數

group
TemplateGroup TemplateGroup TemplateGroup TemplateGroup

要在集合中尋找的 TemplateGroupThe TemplateGroup to locate within the collection.

傳回

在集合中,group 第一次出現之以零起始的索引;如果 group 不在集合中,則為 -1。The zero-based index of the first occurrence of group within the collection; otherwise, -1, if group is not in the collection.

備註

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

會執行線性搜尋; 因此, 平均執行時間會Count與屬性成正比。 IndexOfThe IndexOf 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.

適用於

另請參閱