StorageFolder.GetFoldersAsync(CommonFolderQuery, UInt32, UInt32) | getFoldersAsync(CommonFolderQuery, UInt32, UInt32) method

Applies to Windows and Windows Phone

Gets an index-based range of StorageFolder objects that represent groups of files in the current folder and its subfolders. Files are grouped based on the specified CommonFolderQuery. Folders are included in the range based on their indexes.

Syntax


storageFolder.getFoldersAsync(query, startIndex, maxItemsToRetrieve).done( /* Your success and error handlers */ );

Parameters

query

Type: CommonFolderQuery

One of the enumeration values that specifies how to group the files into folders and determines whether the query is shallow or deep.

startIndex

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

The zero-based index of the first StorageFolder in the range to retrieve.

maxItemsToRetrieve

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

The maximum number of folders to retrieve.

Return value

Type: IAsyncOperation<IVectorView>

When this method completes successfully, it returns a list of folders that represent groups of files. The files are grouped as specified by query. The list is of type IReadOnlyList<StorageFolder>. Each folder in the list is represented by a StorageFolder object.

Remarks

Using a CommonFolderQuery lets you group files into folders based on specific file attributes (like artist or album) quickly and easily.

For library folders such as the PicturesLibrary, the values from the CommonFolderQuery enumeration (except CommonFolderQuery.DefaultQuery) return deep query results from the current folder and its subfolders. For folders that aren't library folders, if you want to retrieve items at all levels under the current folder, create a folder query by calling the CreateFolderQueryWithOptions method. Specify FolderDepth.Deep as the value of the QueryOptions.FolderDepth property.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

See also

StorageFolder
GetFoldersAsync(CommonFolderQuery)
GetFoldersAsync

 

 

Show:
© 2014 Microsoft