StorageFolder.AreQueryOptionsSupported(QueryOptions) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates whether the current folder supports the specified QueryOptions.
public:
virtual bool AreQueryOptionsSupported(QueryOptions ^ queryOptions) = AreQueryOptionsSupported;
bool AreQueryOptionsSupported(QueryOptions const& queryOptions);
public bool AreQueryOptionsSupported(QueryOptions queryOptions);
function areQueryOptionsSupported(queryOptions)
Public Function AreQueryOptionsSupported (queryOptions As QueryOptions) As Boolean
Parameters
- queryOptions
- QueryOptions
The QueryOptions to check.
Returns
bool
True if the folder or file group supports the specified QueryOptions; otherwise false.
Implements
Remarks
QueryOptions let you enumerate files in a folder and its subfolders by letting you specify criteria that you can then use to create a query result object of files in that folder and subfolders. The CommonFileQuery and CommonFolderQuery enumeration represent some of the most common criteria used to filter and enumerate files and folders.
Use the AreQueryOptionsSupported method to verify that the QueryOptions you want to specify are available for the current folder. You can also check whether a specific CommonFileQuery or CommonFolderQuery value is available, by calling IsCommonFileQuerySupported or IsCommonFolderQuerySupported, respectively.
The specific options available to you depend on where the files or folders that you want to enumerate are located. For folders and files that are located inside a library or homegroup, you can use any combination of QueryOptions.
Folders and files outside of a library or homegroup support a only subset of options.
For queries that enumerate only the top-level files or folders (also known as a shallow query), create a QueryOptions object in one of the following three ways:
- Call the default QueryOptions() constructor.
- Call the QueryOptions(CommonFolderQuery) constructor and specify CommonFolderQuery.DefaultQuery.
- Call the QueryOptions(CommonFileQuery, IIterable(String)) constructor and specify CommonFileQuery.DefaultQuery. You can still specify file types to be filtered when you use this constructor.
For queries that enumerate all of the files inside the current folder and its subfolders (also known as a deep query), create a QueryOptions object in one of the following two ways:
- Call the QueryOptions(CommonFolderQuery) constructor and specify CommonFileQuery.OrderByName or CommonFileQuery.OrderBySearchRank.
- Call the QueryOptions(CommonFileQuery, IIterable(String)) constructor and specify CommonFileQuery.OrderByName or CommonFileQuery.OrderBySearchRank. You can still specify file types to be filtered when you use this constructor.
For Windows Server 2012 You must install indexer components to use some QueryOptions, CommonFileQuery values, and CommonFolderQuery values because indexer components are not installed by default.