I​Vector​View<​T> I​Vector​View<​T> I​Vector​View<​T> Interface

Definition

Represents an immutable view into a vector.

.NET This interface appears to .NET code as System.Collections.Generic.IReadOnlyList<T> due to .NET language projection. In any case where a Windows Runtime type has implemented IVectorView;, .NET code can use the APIs of IReadOnlyList<T> instead.

public interface IVectorView<T>public interface IVectorView<T>Public Interface IVectorView<T>
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduced v1)

Remarks

For read-write collections, the IVectorView; interface is still relevant, because the IVector.GetView method returns an IVectorView; instance.

When programming with .NET, this interface is hidden and developers should use the interface if they want to implement a read-only vector/list type. In any case where a Windows Runtime type has implemented IVectorView;, .NET code can use the APIs of instead. This includes all the existing Windows Runtime API and also scenarios such as using the APIs of Windows Runtime components originally implemented in Visual C++ component extensions (C++/CX) from a C# or Visual Basic app.

Interface inheritance

IVectorView inherits IIterable. Types that implement IVectorView also implement the interface members of IIterable. Similarly, if you're using .NET, there is support for IEnumerable<T>.

Properties

Size Size Size

Gets the number of items in the vector view.

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

The number of items in the vector view.

Attributes

Remarks

When programming with .NET, this interface is hidden and developers should use the interface.

Methods

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

Returns the item at the specified index in the vector view.

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

The zero-based index of the item.

Returns
T T T

The item at the specified index.

Attributes

Remarks

When programming with .NET, this interface is hidden and developers should use the interface.

GetMany(UInt32, T[]) GetMany(UInt32, T[]) GetMany(UInt32, T[])

Gets a collection of items from the vector view beginning at the given index.

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

The zero-based index to start at.

items
T[] T[] T[]

An array to copy the items into.

Returns
uint uint uint

A status code indicating the result of the operation.

Attributes

Remarks

When programming with .NET, this interface is hidden. Use the IList interface instead.

IndexOf(T, UInt32) IndexOf(T, UInt32) IndexOf(T, UInt32)

Retrieves the index of a specified item in the vector view.

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

The item to find in the vector view.

index
System.UInt32 System.UInt32 System.UInt32

If the item is found, this is the zero-based index of the item; otherwise, this parameter is 0.

Returns
bool bool bool

true if the item is found; otherwise, false.

Attributes

Remarks

When programming with .NET, this interface is hidden and developers should use the interface.