StorageItemQueryResult.GetItemsAsync(UInt32, UInt32) | getItemsAsync(UInt32, UInt32) method

Applies to Windows only

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

Syntax


storageItemQueryResult.getItemsAsync(startIndex, maxNumberOfItems).done( /* Your success and error handlers */ );

Parameters

startIndex

Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

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

maxNumberOfItems

Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

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.

Return value

Type: IAsyncOperation<IVectorView>

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Storage.Search
Windows::Storage::Search [C++]

Metadata

Windows.winmd

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
StorageItemQueryResult

 

 

Show:
© 2014 Microsoft