TemplateGroupCollection.IndexOf(TemplateGroup) 方法

定義

傳回指定的 TemplateGroup 物件在集合中的索引。

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

傳回

Int32

在集合中,group 第一次出現之以零起始的索引;如果 group 不在集合中,則為 -1。

備註

方法 IndexOf 會使用 Equals 物件上的 TemplateGroup 方法來判斷相等。

IndexOf 執行線性搜尋;因此,平均執行時間會與 Count 屬性成正比。 因為範本群組集合通常很小,所以線性搜尋作業的效能並不重要。

適用於

另請參閱