IVectorView<T> IVectorView<T> IVectorView<T> IVectorView<T> Interface

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<T>, .NET code can use the APIs of IReadOnlyList<T> instead.

Syntax

Declaration

public interface IVectorView<T>public interface IVectorView<T>Public Interface IVectorView<T>public interface IVectorView<T>

Remarks

For read-write collections, the IVectorView<T> interface is still relevant, because the IVector<T> method returns an IVectorView<T> 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<T>, .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<T> inherits IIterable<T>. Types that implement IVectorView<T> also implement the interface members of IIterable<T>. Similarly, if you're using .NET, there is support for IEnumerable<T>.

Properties summary

Gets the number of items in the vector view.

Methods summary

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

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

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

Properties

  • Size
    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 uintpublic uint Size { get; }

    Property Value

    • uint
      uint
      uint
      uint

      The number of items in the vector view.

    Remarks

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

Methods

  • GetAt(UInt32)
    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 Tpublic T GetAt(UInt32 index)

    Parameters

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

      The zero-based index of the item.

    Returns

    • T
      T
      T
      T

      The item at the specified index.

    Remarks

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

  • GetMany(UInt32, T[])
    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 uintpublic uint GetMany(UInt32 startIndex, T[] items)

    Parameters

    • startIndex
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The zero-based index to start at.

    • items
      T[]
      T[]
      T[]
      T[]

      An array to copy the items into.

    Returns

    • uint
      uint
      uint
      uint

      A status code indicating the result of the operation.

    Remarks

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

  • IndexOf(T, UInt32)
    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 boolpublic bool IndexOf(T value, UInt32 index)

    Parameters

    • value
      T
      T
      T
      T

      The item to find in the vector view.

    • index
      System.UInt32
      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
      bool

      true if the item is found; otherwise, false.

    Remarks

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

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.FoundationContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.Foundation.Collections.dll