CommonFileQuery enumeration

Applies to Windows and Windows Phone

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


public enum CommonFileQuery

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 with 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 to determine whether the 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

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:
© 2014 Microsoft