HubSectionCollection Classe

Définition

Représente une collection ordonnée d’objets 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>
Héritage
Object Platform::Object IInspectable HubSectionCollection
Attributs
Implémente

Configuration requise pour Windows

Famille d’appareils
Windows 10 (introduit dans 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduit dans v1.0)

Remarques

HubSectionCollection est le type d’objet que vous obtenez à partir de la propriété Sections d’un hub. Toutes les propriétés qui utilisent un HubSectionCollection dans l’API Windows Runtime sont des propriétés en lecture seule, où la propriété est initialisée avec zéro élément lorsqu’un objet est instancié pour la première fois. Mais vous pouvez ensuite ajouter, supprimer ou interroger des éléments dans la collection au moment de l’exécution, à l’aide des propriétés et méthodes HubSectionCollection.

Énumération de la collection en C# ou Microsoft Visual Basic

HubSectionCollection étant énumérable, vous pouvez utiliser la syntaxe propre au langage, telle que foreach en C# pour énumérer les éléments de la collection. Le compilateur effectue le cast de type pour vous et vous n’aurez pas besoin d’effectuer un cast IEnumerable vers explicitement. Si vous avez besoin d’un cast explicite, par exemple si vous souhaitez appeler GetEnumerator, effectuez un cast en IEnumerable<T> avec une contrainte HubSection .

Propriétés

Size

Obtient la taille (nombre) de la collection.

Méthodes

Append(HubSection)

Ajoute un nouvel élément à la collection.

Clear()

Supprime tous les éléments de la collection.

First()

Retourne l’itérateur pour l’itération sur les éléments de la collection.

GetAt(UInt32)

Retourne l’élément situé à l’index spécifié.

GetMany(UInt32, HubSection[])

Récupère plusieurs éléments en une seule passe à travers l’itérateur.

GetView()

Obtient une vue immuable dans la collection.

IndexOf(HubSection, UInt32)

Récupère l’index de l’élément spécifié.

InsertAt(UInt32, HubSection)

Insère l’élément spécifié à l’index spécifié.

RemoveAt(UInt32)

Supprime l'élément à l'index spécifié.

RemoveAtEnd()

Supprime le dernier élément de la collection.

ReplaceAll(HubSection[])

Efface initialement la collection, puis insère le tableau fourni en tant que nouveaux éléments.

SetAt(UInt32, HubSection)

Définit la valeur à l’index spécifié sur la valeur d’élément spécifiée.

S’applique à

Voir aussi