CommonFileQuery enumeration

Specifies how to sort the files in the query results and determines whether the query is shallow or deep. Query results for deep queries include all files in all of the subfolders of the current folder, sorted according to the specified option.

Syntax


var value = Windows.Storage.Search.CommonFileQuery.defaultQuery;

Attributes

[Version(0x06020000)]

Members

The CommonFileQuery enumeration has these members.

MemberValueDescription
DefaultQuery | defaultQuery0

A shallow list of files in the current folder, similar to the list that File Explorer provides.

You can use this option for any storage location.

OrderByName | orderByName1

A deep, flat list of files in a folder and its subfolders, sorted by System.ItemNameDisplay.

You can use this option for any storage location.

OrderByTitle | orderByTitle2

A deep, flat list of files in a folder and its subfolders, sorted by System.Title.

You can use this option only for folders in a library or the HomeGroup folder.

OrderByMusicProperties | orderByMusicProperties3

A deep, flat list of files in a folder and its subfolders, sorted by music properties.

You can use this option only for folders in a library or the HomeGroup folder.

OrderBySearchRank | orderBySearchRank4

A deep, flat list of files in a folder and its subfolders, sorted by System.Search.Rank followed by System.DateModified.

You can use this option for any storage location.

OrderByDate | orderByDate5

A deep, flat list of files in a folder and its subfolders, sorted by System.ItemDate.

You can use this option only for folders in a library or the HomeGroup folder.

Note  System.ItemDate is a computed property that changes based on the content type; for example, it maps to System.Photo.DateTaken for photos.

Remarks

Use a value from the CommonFileQuery enumeration when you call one of the following methods of the StorageFolder class. For examples that use values from the CommonFileQuery enumeration, see the topics for these methods.

These methods use the value from the CommonFileQuery enumeration to initialize the FolderDepth, IndexerOption, and SortOrder options of the query.

Call the StorageFolder.IsCommonFileQuerySupported method to determine whether the CommonFileQuery value that you want to use is available for the current folder.

Note  

Files that don't have a value for the property that the query uses to sort files are typically excluded from query results.

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

 

 

Show:
© 2015 Microsoft