HubSectionCollection 類別

定義

表示 HubSection 物件的已排序集合。

public ref class HubSectionCollection sealed : IIterable<HubSection ^>, IVector<HubSection ^>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HubSectionCollection final : IIterable<HubSection>, IVector<HubSection>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class HubSectionCollection final : IIterable<HubSection>, IVector<HubSection>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HubSectionCollection : IEnumerable<HubSection>, IList<HubSection>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class HubSectionCollection : IEnumerable<HubSection>, IList<HubSection>
Public NotInheritable Class HubSectionCollection
Implements IEnumerable(Of HubSection), IList(Of HubSection)
<Hub>
  oneOrMoreChildren
</Hub>
繼承
Object Platform::Object IInspectable HubSectionCollection
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

HubSectionCollection 是您從中樞的 Sections屬性取得的物件類型。 Windows 執行階段 API 中使用 HubSectionCollection 的所有屬性都是唯讀屬性,其中屬性會在第一次具現化物件時以零專案初始化。 但是,您可以使用 HubSectionCollection 屬性和方法,在執行時間加入、移除或查詢集合中的專案。

列舉 C# 或 Microsoft Visual Basic 中的集合

HubSectionCollection 是可列舉的,因此您可以使用 C# 中的 foreach 之類的語言特定語法來列舉集合中的專案。 編譯器會為您執行類型轉換,而且您不需要明確地轉換 。 IEnumerable 如果您需要明確轉換,例如,如果您想要呼叫GetEnumerator,請使用HubSection條件約束轉換成IEnumerable < T >

屬性

Size

取得集合) 的大小 (計數。

方法

Append(HubSection)

將新項目加入至集合中。

Clear()

移除集合的所有項目。

First()

傳回反覆運算器,以反復查看集合中的專案。

GetAt(UInt32)

傳回位於指定索引處的專案。

GetMany(UInt32, HubSection[])

擷取單一傳遞反覆運算器中的多個專案。

GetView()

取得集合中的不可變檢視。

IndexOf(HubSection, UInt32)

擷取指定專案的索引。

InsertAt(UInt32, HubSection)

在指定的索引處插入指定的專案。

RemoveAt(UInt32)

移除指定之索引處的項目。

RemoveAtEnd()

移除集合中的最後一個專案。

ReplaceAll(HubSection[])

一開始會清除集合,然後將提供的陣列插入為新專案。

SetAt(UInt32, HubSection)

將位於指定索引處的值設定為指定的專案值。

適用於

另請參閱