Jaa


StorageItemQueryResult.GetItemsAsync Method

Definition

Overloads

GetItemsAsync()

Retrieves a list of all the items (files and folders) in the query results set.

GetItemsAsync(UInt32, UInt32)

Retrieves a list of items (files and folders) in a specified range.

GetItemsAsync()

Retrieves a list of all the items (files and folders) in the query results set.

public:
 virtual IAsyncOperation<IVectorView<IStorageItem ^> ^> ^ GetItemsAsync() = GetItemsAsync;
/// [Windows.Foundation.Metadata.Overload("GetItemsAsyncDefaultStartAndCount")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<IStorageItem>> GetItemsAsync();
[Windows.Foundation.Metadata.Overload("GetItemsAsyncDefaultStartAndCount")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<IStorageItem>> GetItemsAsync();
function getItemsAsync()
Public Function GetItemsAsync () As IAsyncOperation(Of IReadOnlyList(Of IStorageItem))

Returns

When this method completes successfully, it returns a list (type IVectorView) of items. Each item is the IStorageItem type and represents a file, folder, or file group.

In this list, files are represented by StorageFile objects, and folders or file groups are represented by StorageFolder objects.

Attributes

See also

Applies to

GetItemsAsync(UInt32, UInt32)

Retrieves a list of items (files and folders) in a specified range.

public:
 virtual IAsyncOperation<IVectorView<IStorageItem ^> ^> ^ GetItemsAsync(unsigned int startIndex, unsigned int maxNumberOfItems) = GetItemsAsync;
/// [Windows.Foundation.Metadata.Overload("GetItemsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<IStorageItem>> GetItemsAsync(uint32_t const& startIndex, uint32_t const& maxNumberOfItems);
[Windows.Foundation.Metadata.Overload("GetItemsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<IStorageItem>> GetItemsAsync(uint startIndex, uint maxNumberOfItems);
function getItemsAsync(startIndex, maxNumberOfItems)
Public Function GetItemsAsync (startIndex As UInteger, maxNumberOfItems As UInteger) As IAsyncOperation(Of IReadOnlyList(Of IStorageItem))

Parameters

startIndex
UInt32

unsigned int

uint32_t

The zero-based index of the first item to retrieve. This parameter defaults to 0.

maxNumberOfItems
UInt32

unsigned int

uint32_t

The maximum number of items to retrieve. Use -1 to retrieve all items. If the range contains fewer items than the max number, all items in the range are returned.

Returns

When this method completes successfully, it returns a list (type IVectorView) of items. Each item is the IStorageItem type and represents a file, folder, or file group.

In this list, files are represented by StorageFile objects, and folders or file groups are represented by StorageFolder objects.

Attributes

Remarks

You can use the IsOfType method on both types of storage objects to find out whether an item is a StorageFile or StorageFolder object.

For C#/C++/VB: After you know whether the item is a StorageFile or StorageFolder, you can then cast the item to the appropriate type in order to access properties and methods specific to that object.

Use this overload to improve system performance by presenting a virtualized view of the query results that includes only the necessary subset of folders. For example, if your app displays many items in a gallery you could use this range to retrieve only the items that are currently visible to the user.

See also

Applies to