CommonFolderQuery Enum

Definition

Specifies how to group files into folders 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, grouped into folders according to the specified option.

public enum class CommonFolderQuery
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class CommonFolderQuery
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum CommonFolderQuery
var value = Windows.Storage.Search.CommonFolderQuery.defaultQuery
Public Enum CommonFolderQuery
Inheritance
CommonFolderQuery
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

DefaultQuery 0

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

You can use this option for any storage location.

GroupByAlbum 103

Group files into virtual folders by year based on the System.Music.AlbumTitle property of each file. Each folder will contain all (and only) files with identical values for System.Music.AlbumTitle.

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

GroupByAlbumArtist 104

Group files into virtual folders based on the System.Music.AlbumArtist property of each file. Each folder will contain all (and only) files with identical values for System.Music.AlbumArtist.

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

GroupByArtist 102

Group files into virtual folders based on the System.Music.Artist property of each file. Each folder will contain all (and only) files with identical values for System.Music.Artist.

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

GroupByAuthor 110

Group files into virtual folders based on the System.Author property of each file. Each folder will represent one author, and contain all files whose System.Author vector contains that author. If a file lists multiple authors, it may appear in more than one of the resulting folders.

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

GroupByComposer 105

Group files into virtual folders based on the System.Music.Composer property of each file. Each folder will represent one composer, and contain all files whose System.Music.Composer vector contains that composer. If a file lists multiple composers, it may appear in more than one of the resulting folders.

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

GroupByGenre 106

Group files into virtual folders based on the System.Music.Genre property of each file. Each folder will contain all (and only) files with identical values for System.Music.Genre.

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

GroupByMonth 101

Group files into virtual folders by month based on the System.ItemDate property of each file. Each folder will contain all (and only) files that have values for System.ItemDate within the same month.

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

GroupByPublishedYear 107

Group files into virtual folders by year based on the System.Media.Year property of each file. Each folder will contain all (and only) files that have values for System.Media.Year within the same year.

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

GroupByRating 108

Group files into virtual folders by rating (1 star, 2 stars, and so on) based on the System.Rating property of each file. Each folder will contain all (and only) files with identical values for System.Rating.

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

GroupByTag 109

Group files into virtual folders based on the System.Keywords property of each file. Each folder will represent one tag, and contain all files whose System.Keywords vector contains that tag. If a file lists multiple tags in its System.Keywords vector, it may appear in more than one of the resulting folders.

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

GroupByType 111

Group files into virtual folders by type (for example, Microsoft Word documents, text files, and so forth) based on the System.ItemTypeText property of each file.

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

GroupByYear 100

Group files into virtual folders by year based on the System.ItemDate property of each file. Each folder will contain all (and only) files that have values for System.ItemDate within the same year.

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

Remarks

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

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

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

Tip

When a query groups files into virtual folders based on a property that can have multiple values (for example, System.Author), a particular file may appear in more than one virtual folder because each folder represents one of the multiple values.

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

Applies to

See also