Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 2.71 KB

storageitemqueryresult_getitemsasync_561011846.md

File metadata and controls

37 lines (25 loc) · 2.71 KB
-api-id -api-type
M:Windows.Storage.Search.StorageItemQueryResult.GetItemsAsync(System.UInt32,System.UInt32)
winrt method

Windows.Storage.Search.StorageItemQueryResult.GetItemsAsync

-description

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

-parameters

-param startIndex

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

-param maxNumberOfItems

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.

-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.

-examples

-see-also

StorageItemQueryResult class, StorageItemQueryResult.GetItemsAsync() method, Windows.Foundation.Collections.IVectorView interface, Windows.Storage.IStorageItem interface, Windows.Storage.IStorageItem.IsOfType method, Windows.Storage.StorageFile class, Windows.Storage.StorageFolder class