PnpObjectCollection PnpObjectCollection PnpObjectCollection PnpObjectCollection Class

Definition

Represents an iterable collection of Pnp device objects.

public sealed class PnpObjectCollectionpublic sealed class PnpObjectCollectionPublic NotInheritable Class PnpObjectCollectionpublic sealed class PnpObjectCollection
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Collection member lists

For JavaScript, PnpObjectCollection has the members shown in the member lists. In addition, PnpObjectCollection supports a length property, members of Array.prototype, and using an index to access items.

Enumerating the collection in C# or Microsoft Visual Basic

PnpObjectCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<PnpObject> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with a PnpObject constraint.

Properties

Size Size Size Size

Returns the number of items in the collection.

public uint Size { get; }public uint Size { get; }Public ReadOnly Property Size As uintpublic uint Size { get; }
Value
uint uint uint uint

The number of items in the collection.

Attributes

Methods

First() First() First() First()

Returns the iterator for iteration over the items in the collection.

public IIterator<PnpObject> First()public IIterator<PnpObject> First()Public Function First() As IIterator( Of PnpObject )public IIterator<PnpObject> First()
Returns

The iterator object. The iterator's current position is at the 0-index position, or at the end of the collection if the collection is empty.

Attributes

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the PnpObject located at the specified index.

public PnpObject GetAt(UInt32 index)public PnpObject GetAt(UInt32 index)Public Function GetAt(index As UInt32) As PnpObjectpublic PnpObject GetAt(UInt32 index)
Parameters
index
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The integer index for the value to retrieve.

Returns

The PnpObject at the specified index.

Attributes

GetMany(UInt32, PnpObject[]) GetMany(UInt32, PnpObject[]) GetMany(UInt32, PnpObject[]) GetMany(UInt32, PnpObject[])

Retrieves multiple elements in a single pass through the iterator.

public uint GetMany(UInt32 startIndex, PnpObject[] items)public uint GetMany(UInt32 startIndex, PnpObject[] items)Public Function GetMany(startIndex As UInt32, items As PnpObject[]) As uintpublic uint GetMany(UInt32 startIndex, PnpObject[] items)
Parameters
startIndex
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The index from which to start retrieval.

items
Windows.Devices.Enumeration.Pnp.PnpObject[] Windows.Devices.Enumeration.Pnp.PnpObject[] Windows.Devices.Enumeration.Pnp.PnpObject[] Windows.Devices.Enumeration.Pnp.PnpObject[]

Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results should be retrieved.

Returns
uint uint uint uint

The number of items retrieved.

Attributes

IndexOf(PnpObject, UInt32) IndexOf(PnpObject, UInt32) IndexOf(PnpObject, UInt32) IndexOf(PnpObject, UInt32)

Retrieves the index of the specified item.

public bool IndexOf(PnpObject value, UInt32 index)public bool IndexOf(PnpObject value, UInt32 index)Public Function IndexOf(value As PnpObject, index As UInt32) As boolpublic bool IndexOf(PnpObject value, UInt32 index)
Parameters
value
PnpObject PnpObject PnpObject PnpObject

The value to find in the collection.

index
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The index of the item to find, if found.

Returns
bool bool bool bool

True if an item with the specified value was found; otherwise, False.

Attributes