Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PnpObjectCollection class

Applies to Windows and Windows Phone

Represents an iterable collection of Pnp device objects.

Syntax


public sealed class PnpObjectCollection : IReadOnlyList<PnpObject>,
    IEnumerable<PnpObject>

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The PnpObjectCollection class has these types of members:

Methods

The PnpObjectCollection class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
First [C++, JavaScript]Returns the iterator for iteration over the items in the collection.
GetAt [C++, JavaScript]Returns the PnpObject located at the specified index.
GetMany [C++, JavaScript]Retrieves multiple elements in a single pass through the iterator.
IndexOf [C++, JavaScript]Retrieves the index of the specified item.

 

Properties

The PnpObjectCollection class has these properties.

PropertyAccess typeDescription

Count [C#, VB]

Read-onlyGets the number of elements contained in the collection.

Item [C#, VB]

Read-onlyGets or sets the element at the specified index.

Size [C++, JavaScript]

Read-onlyReturns the number of items in the collection.

 

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.

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Enumeration.Pnp
Windows::Devices::Enumeration::Pnp [C++]

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft