語言

RoleGroupCollection 類別

定義

包含一個依序列出的角色群組, LoginView 控制項用來決定根據使用者的角色顯示哪個控制範本。 此類別無法獲得繼承。

public ref class RoleGroupCollection sealed : System::Collections::CollectionBase
public sealed class RoleGroupCollection : System.Collections.CollectionBase
type RoleGroupCollection = class
    inherit CollectionBase
Public NotInheritable Class RoleGroupCollection
Inherits CollectionBase
繼承
RoleGroupCollection

備註

該 RoleGroupCollection 類別管理與特定 LoginView 範本相關的角色群組清單。 每個角色群組定義要在你網站上向特定用戶群展示的內容和控制項。 可以將多個角色群組指派到同一範本。

要找到特定使用者所屬的集合中的角色群組,你可以使用 GetMatchingRoleGroup 該方法依使用者名稱搜尋集合。

注意事項

集合中 RoleGroupCollection 角色的順序很重要,因為匹配是依序依據第一個找到的角色進行。

你必須設定角色管理,才能使用 RoleGroupCollection 該類別來管理角色群組清單。 欲了解更多資訊,請參閱 《理解角色管理》。

建構函式

名稱 Description
RoleGroupCollection()

初始化 RoleGroupCollection 類別的新執行個體。

屬性

名稱 Description
Capacity

取得或設定 CollectionBase 可以包含的項目數目。

(繼承來源 CollectionBase)
Count

取得該實例中包含 CollectionBase 的元素數量。 此屬性無法覆寫。

(繼承來源 CollectionBase)
InnerList

取得包含實ArrayList例中元素清單的 。CollectionBase

(繼承來源 CollectionBase)
Item[Int32]

取得指定索引中的角色群組。

List

取得包含實IList例中元素清單的 。CollectionBase

(繼承來源 CollectionBase)

方法

名稱 Description
Add(RoleGroup)

在集合的末尾新增一個角色群組。

Clear()

移除實例中 CollectionBase 的所有物件。 此方法無法被覆蓋。

(繼承來源 CollectionBase)
Contains(RoleGroup)

表示該集合是否包含指定的角色群組。

CopyTo(RoleGroup[], Int32)

將集合中 RoleGroupCollection 的所有項目複製到相容的一維物件陣列 RoleGroup ,從目標陣列指定的索引開始。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetEnumerator()

回傳一個枚舉器,會遍歷該 CollectionBase 實例。

(繼承來源 CollectionBase)
GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetMatchingRoleGroup(IPrincipal)

回傳包含指定使用者帳號的第一個角色群組。

GetType()

取得目前實例的 Type。

(繼承來源 Object)
IndexOf(RoleGroup)

搜尋集合,並回傳指定 首次出現 RoleGroup的零為基礎索引。

Insert(Int32, RoleGroup)

在指定索引處將 a RoleGroup 加入集合。

MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
OnClear()

在清除實例內容 CollectionBase 時執行額外的自訂程序。

(繼承來源 CollectionBase)
OnClearComplete()

清除實例內容 CollectionBase 後,執行額外的自訂程序。

(繼承來源 CollectionBase)
OnInsert(Int32, Object)

在插入新元素前 CollectionBase ,執行額外的自訂程序。

(繼承來源 CollectionBase)
OnInsertComplete(Int32, Object)

插入新元素後 CollectionBase 執行額外的自訂程序。

(繼承來源 CollectionBase)
OnRemove(Int32, Object)

移除實例中的 CollectionBase 元素時,會執行額外的自訂程序。

(繼承來源 CollectionBase)
OnRemoveComplete(Int32, Object)

移除實 CollectionBase 例元素後,執行額外的自訂程序。

(繼承來源 CollectionBase)
OnSet(Int32, Object, Object)

在設定實例值 CollectionBase 前,執行額外的自訂程序。

(繼承來源 CollectionBase)
OnSetComplete(Int32, Object, Object)

在實例設定值 CollectionBase 後,執行額外的自訂程序。

(繼承來源 CollectionBase)
OnValidate(Object)

在驗證值時執行額外的自訂流程。

(繼承來源 CollectionBase)
Remove(RoleGroup)

從集合中刪除指定角色群組的首次出現。

RemoveAt(Int32)

移除實例指定索引 CollectionBase 的元素。 此方法無法被覆蓋。

(繼承來源 CollectionBase)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

明確介面實作

名稱 Description
ICollection.CopyTo(Array, Int32)

從目標陣列的指定索引開始,將整個 CollectionBase 複製到相容的一維 Array。

(繼承來源 CollectionBase)
ICollection.IsSynchronized

取得值,指出是否同步存取 CollectionBase (線程安全)。

(繼承來源 CollectionBase)
ICollection.SyncRoot

取得一個物件,可用來同步存取 CollectionBase。

(繼承來源 CollectionBase)
IList.Add(Object)

將物件加入至 CollectionBase的結尾。

(繼承來源 CollectionBase)
IList.Contains(Object)

判斷是否 CollectionBase 包含特定元素。

(繼承來源 CollectionBase)
IList.IndexOf(Object)

搜尋指定的 Object,並傳回整個 CollectionBase內第一個出現專案的以零起始的索引。

(繼承來源 CollectionBase)
IList.Insert(Int32, Object)

將專案插入指定索引處的 CollectionBase。

(繼承來源 CollectionBase)
IList.IsFixedSize

取得值,指出 CollectionBase 是否有固定大小。

(繼承來源 CollectionBase)
IList.IsReadOnly

取得值,指出 CollectionBase 是否為唯讀。

(繼承來源 CollectionBase)
IList.Item[Int32]

取得或設定位於指定索引處的專案。

(繼承來源 CollectionBase)
IList.Remove(Object)

從 CollectionBase移除第一個出現的特定物件。

(繼承來源 CollectionBase)

擴充方法

名稱 Description
AsParallel(IEnumerable)

啟用查詢的平行處理。

AsQueryable(IEnumerable)

將 IEnumerable 轉換成 IQueryable。

Cast<TResult>(IEnumerable)

將 IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別篩選 IEnumerable 的專案。

適用於

另請參閱