Specifies whether the query is shallow or deep and the sorting criteria to use to group files into folders in the query results. Query results for deep queries include all files in all of the subfolders of the folder being queried and groups them based on the specified metadata.
Syntax
var value = Windows.Storage.Search.CommonFolderQuery.defaultQuery;
Attributes
- VersionAttribute(NTDDI_WIN8)
Members
The CommonFolderQuery enumeration has these members.
| Member | Value | Description |
|---|---|---|
| DefaultQuery | defaultQuery | 0 |
A shallow view of the folders in the queried folder, similar to the view that Windows Explorer provides. This option is valid with any location. |
| GroupByYear | 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. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByMonth | groupByMonth | 101 |
Group files into virtual folders by month based on the System.ItemDate property of each file. Each resulting folder will contain all (and only) files that have values for System.ItemDate within the same month. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByArtist | groupByArtist | 102 |
Group files into virtual folders based on the System.Music.Artistproperty of each file. Each resulting folder will contain all (and only) files with identical values for System.Music.Artist. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByAlbum | groupByAlbum | 103 |
Group files into virtual folders by year based on the System.Music.AlbumTitle property of each file. Each resulting folder will contain all (and only) files with identical values for System.Music.AlbumTitle. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByAlbumArtist | groupByAlbumArtist | 104 |
Group files into virtual folders based on the System.Music.AlbumArtist property of each file. Each resulting folder will contain all (and only) files with identical values for System.Music.AlbumArtist. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByComposer | groupByComposer | 105 |
Group files into virtual folders based on the System.Music.Composer property of each file. Each resulting 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. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByGenre | groupByGenre | 106 |
Group files into virtual folders based on the System.Music.Genre property of each file. Each resulting folder will contain all (and only) files with identical values for System.Music.Genre. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByPublishedYear | groupByPublishedYear | 107 |
Group files into virtual folders by year based on the System.Media.Year property of each file. Each resulting folder will contain all (and only) files that have values for System.Media.Year within the same year. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByRating | 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 resulting folder will contain all (and only) files with identical values for System.Rating. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByTag | groupByTag | 109 |
Group files into virtual folders based on the System.Keywords property of each file. Each resulting 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. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByAuthor | groupByAuthor | 110 |
Group files into virtual folders based on the System.Author property of each file. Each resulting 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. This option only works if the folder being queried is in a library or the HomeGroup folder. |
| GroupByType | groupByType | 111 |
Group files into virtual folders by type (Word documents, text files, and so on) based on the System.ItemTypeText property of each file. This option only works if the folder being queried is in a library or the HomeGroup folder. |
Remarks
When grouping files into virtual folders based on multi-valued properties (like System.Author) a particular file may appear in more than one folder because each group represents a unique value.
Use this enumeration to construct QueryOptions or create a StorageFolderQueryResult by calling one of these methods:
Those methods use the enumeration to initialize the DateStackOption, FolderDepth, IndexerOption, and SortOrder options of the query.
You can use the StorageFolderQueryResult object to enumerate the contents of the resulting folders.
Examples
Use this enumeration to specify how to group files by rating in a storageFolder location, as in the following example.
var picturesLibrary = Windows.Storage.KnownFolders.picturesLibrary; var storageFolderQueryResults = picturesLibrary.createFolderQuery(Windows.Storage.Search.CommonFolderQuery.groupByRating);
Note In the example we use the Pictures library, but you can use any location that you have access to and that can be represented by a storageFolder object.
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013