CommonFileQuery CommonFileQuery CommonFileQuery CommonFileQuery Enum

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

Declaration

public enum CommonFileQuerypublic enum CommonFileQueryPublic Enum CommonFileQuerypublic enum CommonFileQuery

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.

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

Tip

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

Fields

DefaultQuery
DefaultQuery
DefaultQuery
DefaultQuery

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.

OrderByDate
OrderByDate
OrderByDate
OrderByDate

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.

OrderByMusicProperties
OrderByMusicProperties
OrderByMusicProperties
OrderByMusicProperties

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.

OrderByName
OrderByName
OrderByName
OrderByName

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.

OrderBySearchRank
OrderBySearchRank
OrderBySearchRank
OrderBySearchRank

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.

OrderByTitle
OrderByTitle
OrderByTitle
OrderByTitle

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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Storage.Search.dll