語言

WebPartDescriptionCollection 類別

定義

由一組 WebPartDescription 物件組成,供控制目錄 WebPart 使用。 此類別無法獲得繼承。

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

備註

該 WebPartDescriptionCollection 類別是由各種 CatalogPart 控制項在方法實作 GetAvailableWebPartDescriptions 中所建立。 對於包含在控制項中的WebPart每個CatalogPart控制項,都會建立一個WebPartDescription物件。 此物件維護控制 WebPart 項的基本資訊,包括其識別碼、標題、描述及指向相關圖示的路徑。 各種 CatalogPart 控制項可以使用物件 WebPartDescription 在目錄中顯示控制 WebPart 項的資訊,而無需建立控制項本身的實例 WebPart 。

此 WebPartDescriptionCollection 類別由 Web Parts 控制集內部使用,以維護目錄中所有 WebPartDescription 物件的集合。 WebPartDescriptionCollection該收藏僅在頁面處於目錄顯示模式時使用。 當 CatalogPart 控制項正在渲染時,會循環瀏覽整個 WebPartDescriptionCollection 集合,將每個 WebPartDescription 物件的資訊加入顯示的目錄中。

建構函式

名稱 Description
WebPartDescriptionCollection()

初始化一個空的新類別實例 WebPartDescriptionCollection 。

WebPartDescriptionCollection(ICollection)

透過傳遞WebPartDescriptionCollection一組ICollection物件來初始化一個物件的新WebPartDescription實例。

屬性

名稱 Description
Count

取得該實例中包含 ReadOnlyCollectionBase 的元素數量。

(繼承來源 ReadOnlyCollectionBase)
InnerList

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

(繼承來源 ReadOnlyCollectionBase)
Item[Int32]

根據收藏中的索引獲得該收藏的成員。

Item[String]

根據唯一的字串識別碼取得集合成員。

方法

名稱 Description
Contains(WebPartDescription)

回傳一個值,表示集合中是否存在特定控制項。

CopyTo(WebPartDescription[], Int32)

將集合複製到一組 WebPartDescription 物件陣列。

Equals(Object)

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

(繼承來源 Object)
GetEnumerator()

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

(繼承來源 ReadOnlyCollectionBase)
GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetType()

取得目前實例的 Type。

(繼承來源 Object)
IndexOf(WebPartDescription)

回傳集合中特定成員的位置。

MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

明確介面實作

名稱 Description
ICollection.CopyTo(Array, Int32)

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

(繼承來源 ReadOnlyCollectionBase)
ICollection.IsSynchronized

取得值,指出對 ReadOnlyCollectionBase 物件的存取是否同步處理 (線程安全)。

(繼承來源 ReadOnlyCollectionBase)
ICollection.SyncRoot

取得對象,這個物件可用來同步存取 ReadOnlyCollectionBase 物件。

(繼承來源 ReadOnlyCollectionBase)

擴充方法

名稱 Description
AsParallel(IEnumerable)

啟用查詢的平行處理。

AsQueryable(IEnumerable)

將 IEnumerable 轉換成 IQueryable。

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

適用於

另請參閱