PnpObjectCollection
PnpObjectCollection
PnpObjectCollection
PnpObjectCollection
Class
Definition
Represents an iterable collection of Pnp device objects.
public : sealed class PnpObjectCollection : IIterable, IVectorViewpublic sealed class PnpObjectCollection : IEnumerable, IReadOnlyListPublic NotInheritable Class PnpObjectCollection Implements IEnumerable, IReadOnlyList// You can use this class in JavaScript.
- Attributes
| 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
Properties
Item[Int32] Item[Int32] Item[Int32] Item[Int32]
Gets the element at the specified index in the read-only list.
This member is not implemented in C++T this[int index] { get; }ReadOnly Property Item(index As Integer) As TT this[int index] { get; }
- index
The zero-based index of the element to get.
- Value
- T T T T
The element at the specified index in the read-only list.
Methods
First() First() First() First()
Returns the iterator for iteration over the items in the collection.
public : IIterator<PnpObject> First()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
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.
GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)
Returns the PnpObject located at the specified index.
public : PnpObject GetAt(unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
- index
- unsigned int UInt32 UInt32 UInt32
The integer index for the value to retrieve.
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()
Returns an enumerator that iterates through the collection.
This member is not implemented in C++IEnumerator<T> GetEnumerator()Function GetEnumerator As IEnumerator(Of T)IEnumerator<T> GetEnumerator()
An enumerator that can be used to iterate through the collection.
GetMany(UInt32, PnpObject[]) GetMany(UInt32, PnpObject[]) GetMany(UInt32, PnpObject[]) GetMany(UInt32, PnpObject[])
Retrieves multiple elements in a single pass through the iterator.
public : unsigned int GetMany(unsigned int startIndex, PnpObject[] items)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
- startIndex
- unsigned int UInt32 UInt32 UInt32
The index from which to start retrieval.
- items
- PnpObject[] PnpObject[] PnpObject[] 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.
The number of items retrieved.
IndexOf(PnpObject, UInt32) IndexOf(PnpObject, UInt32) IndexOf(PnpObject, UInt32) IndexOf(PnpObject, UInt32)
Retrieves the index of the specified item.
public : PlatForm::Boolean IndexOf(PnpObject value, unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
- index
- unsigned int UInt32 UInt32 UInt32
The index of the item to find, if found.
True if an item with the specified value was found; otherwise, False.