IStorageFolderQueryOperations
IStorageFolderQueryOperations
IStorageFolderQueryOperations
IStorageFolderQueryOperations
Interface
Definition
Provides methods to create search queries and retrieve files from a folder. This interface is implemented by StorageFolder objects, which can represent file system folders, libraries, or virtual folders that are automatically generated when queries are created using group-based CommonFolderQuery values like GroupByAlbum.
public : interface IStorageFolderQueryOperationspublic interface IStorageFolderQueryOperationsPublic Interface IStorageFolderQueryOperations// You can use this interface in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Methods
AreQueryOptionsSupported(QueryOptions) AreQueryOptionsSupported(QueryOptions) AreQueryOptionsSupported(QueryOptions) AreQueryOptionsSupported(QueryOptions)
Verifies whether the folder supports the specified search query options (returns true or false).
public : PlatForm::Boolean AreQueryOptionsSupported(QueryOptions queryOptions)public bool AreQueryOptionsSupported(QueryOptions queryOptions)Public Function AreQueryOptionsSupported(queryOptions As QueryOptions) As bool// You can use this method in JavaScript.
- queryOptions
- QueryOptions QueryOptions QueryOptions QueryOptions
The search query options to test.
True if the folder supports the specified search query options; otherwise false.
Remarks
Not all locations support all query options. Because folders can be retrieved by the picker and you can't control the location, you can use this method to determine whether the location supports a particular query option.
Folders in a library or the HomeGroup support all query options. Other locations only support the following options:
- A shallow enumeration, such as CommonFileQuery.DefaultQuery or CommonFolderQuery.DefaultQuery, or a QueryOptions class that was created with no constructor arguments.
- A deep, flat list of files sorted by name, such as CommonFileQuery.orderByName or the equivalent QueryOptions class.
- A deep, flat list of files sorted by search rank, such as CommonFileQuery.orderBySearchRank or the equivalent QueryOptions class.
CreateFileQuery() CreateFileQuery() CreateFileQuery() CreateFileQuery()
Retrieves an object for enumerating the files in a storage location and subscribing to events that fire when the contents of the storage location change.
public : StorageFileQueryResult CreateFileQuery()public StorageFileQueryResult CreateFileQuery()Public Function CreateFileQuery() As StorageFileQueryResult// You can use this method in JavaScript.
An object for enumerating files and subscribing to events.
- See Also
CreateFileQuery(CommonFileQuery) CreateFileQuery(CommonFileQuery) CreateFileQuery(CommonFileQuery) CreateFileQuery(CommonFileQuery)
Retrieves an object with the specified options for enumerating the storage location in a folder and subscribing to events that fire when the contents of the storage location change.
public : StorageFileQueryResult CreateFileQuery(CommonFileQuery query)public StorageFileQueryResult CreateFileQuery(CommonFileQuery query)Public Function CreateFileQuery(query As CommonFileQuery) As StorageFileQueryResult// You can use this method in JavaScript.
The type of folder query to perform. This parameter defaults to CommonFileQuery.DefaultQuery.
An object for enumerating files and subscribing to events.
- See Also
CreateFileQueryWithOptions(QueryOptions) CreateFileQueryWithOptions(QueryOptions) CreateFileQueryWithOptions(QueryOptions) CreateFileQueryWithOptions(QueryOptions)
Retrieves an object with the specified options for enumerating the files in a storage location and subscribing to events that fire when the contents of the storage location change.
public : StorageFileQueryResult CreateFileQueryWithOptions(QueryOptions queryOptions)public StorageFileQueryResult CreateFileQueryWithOptions(QueryOptions queryOptions)Public Function CreateFileQueryWithOptions(queryOptions As QueryOptions) As StorageFileQueryResult// You can use this method in JavaScript.
- queryOptions
- QueryOptions QueryOptions QueryOptions QueryOptions
The options for filtering the query results.
An object for enumerating files and subscribing to events.
CreateFolderQuery() CreateFolderQuery() CreateFolderQuery() CreateFolderQuery()
Retrieves an object for enumerating folders in a storage location and subscribing to events that fire when the contents of the storage location change.
public : StorageFolderQueryResult CreateFolderQuery()public StorageFolderQueryResult CreateFolderQuery()Public Function CreateFolderQuery() As StorageFolderQueryResult// You can use this method in JavaScript.
An object for enumerating folders and subscribing to events.
- See Also
CreateFolderQuery(CommonFolderQuery) CreateFolderQuery(CommonFolderQuery) CreateFolderQuery(CommonFolderQuery) CreateFolderQuery(CommonFolderQuery)
Retrieves an object with the specified options for enumerating folders in a storage location and subscribing to events that fire when the contents of the storage location change.
public : StorageFolderQueryResult CreateFolderQuery(CommonFolderQuery query)public StorageFolderQueryResult CreateFolderQuery(CommonFolderQuery query)Public Function CreateFolderQuery(query As CommonFolderQuery) As StorageFolderQueryResult// You can use this method in JavaScript.
The type of folder query to perform. This parameter defaults to CommonFolderQuery.DefaultQuery.
An object for enumerating folders and subscribing to events.
- See Also
CreateFolderQueryWithOptions(QueryOptions) CreateFolderQueryWithOptions(QueryOptions) CreateFolderQueryWithOptions(QueryOptions) CreateFolderQueryWithOptions(QueryOptions)
Retrieves an object with the specified options for enumerating folders in a storage location and subscribing to events that fire when the contents of the storage location change.
public : StorageFolderQueryResult CreateFolderQueryWithOptions(QueryOptions queryOptions)public StorageFolderQueryResult CreateFolderQueryWithOptions(QueryOptions queryOptions)Public Function CreateFolderQueryWithOptions(queryOptions As QueryOptions) As StorageFolderQueryResult// You can use this method in JavaScript.
- queryOptions
- QueryOptions QueryOptions QueryOptions QueryOptions
The options for filtering the query results.
An object for enumerating folders and subscribing to events.
Remarks
You can use QueryOptions and CreateFileQueryWithOptions to create an indexed backed file query that lets you get properties that rely on another app's property handler. For more information see QueryOptions.
CreateItemQuery() CreateItemQuery() CreateItemQuery() CreateItemQuery()
Retrieves an object for performing shallow enumerations of the files and folders in a storage location. An app can use the object to enumerate the items in a storage location and subscribe to events that fire when the contents of the storage location change.
public : StorageItemQueryResult CreateItemQuery()public StorageItemQueryResult CreateItemQuery()Public Function CreateItemQuery() As StorageItemQueryResult// You can use this method in JavaScript.
An object for enumerating storage items and subscribing to events.
CreateItemQueryWithOptions(QueryOptions) CreateItemQueryWithOptions(QueryOptions) CreateItemQueryWithOptions(QueryOptions) CreateItemQueryWithOptions(QueryOptions)
Retrieves an object with the specified options for enumerating the files and folders in a storage location and subscribing to events that fire when the contents of the storage location change.
public : StorageItemQueryResult CreateItemQueryWithOptions(QueryOptions queryOptions)public StorageItemQueryResult CreateItemQueryWithOptions(QueryOptions queryOptions)Public Function CreateItemQueryWithOptions(queryOptions As QueryOptions) As StorageItemQueryResult// You can use this method in JavaScript.
- queryOptions
- QueryOptions QueryOptions QueryOptions QueryOptions
The options for filtering the query results.
An object for enumerating storage items and subscribing to events.
Remarks
Don't set QueryOptions.FolderDepth to FolderDepth.Deep; deep queries do not work if you are querying files in a Digital Living Network Alliance (DLNA) device.
GetFilesAsync(CommonFileQuery) GetFilesAsync(CommonFileQuery) GetFilesAsync(CommonFileQuery) GetFilesAsync(CommonFileQuery)
Retrieves a list of files based on the specified query (shallow enumeration). This returns a snapshot of the files at a point in time and does not allow you to keep track of changes through events.
public : IAsyncOperation<IVectorView<StorageFile>> GetFilesAsync(CommonFileQuery query)public IAsyncOperation<IReadOnlyList<StorageFile>> GetFilesAsync(CommonFileQuery query)Public Function GetFilesAsync(query As CommonFileQuery) As IAsyncOperation( Of IReadOnlyListStorageFile )// You can use this method in JavaScript.
The type of file query to perform.
When this method completes successfully, it returns a list (type IVectorView ) of files that are represented by StorageFile objects.
GetFilesAsync(CommonFileQuery, UInt32, UInt32) GetFilesAsync(CommonFileQuery, UInt32, UInt32) GetFilesAsync(CommonFileQuery, UInt32, UInt32) GetFilesAsync(CommonFileQuery, UInt32, UInt32)
Retrieves a list of files in a specified range that are based on the specified file query. This returns a snapshot of the files at a point in time and does not allow you to keep track of changes through events.
public : IAsyncOperation<IVectorView<StorageFile>> GetFilesAsync(CommonFileQuery query, unsigned int startIndex, unsigned int maxItemsToRetrieve)public IAsyncOperation<IReadOnlyList<StorageFile>> GetFilesAsync(CommonFileQuery query, UInt32 startIndex, UInt32 maxItemsToRetrieve)Public Function GetFilesAsync(query As CommonFileQuery, startIndex As UInt32, maxItemsToRetrieve As UInt32) As IAsyncOperation( Of IReadOnlyListStorageFile )// You can use this method in JavaScript.
The type of file query to perform.
- startIndex
- unsigned int UInt32 UInt32 UInt32
The zero-based index of the first file in the range. This parameter defaults to 0.
- maxItemsToRetrieve
- unsigned int UInt32 UInt32 UInt32
The maximum number of files to retrieve. Use -1 to retrieve all files.
When this method completes successfully, it returns a list (type IVectorView ) of files that are represented by StorageFile objects.
Remarks
Use this overload to retrieve improve system performance by presenting a virtual view of the query results that includes only the necessary subset of files.
GetFoldersAsync(CommonFolderQuery) GetFoldersAsync(CommonFolderQuery) GetFoldersAsync(CommonFolderQuery) GetFoldersAsync(CommonFolderQuery)
Retrieves a list of folders and file groups based on a specified folder query. This returns a snapshot of the folders or file groups at a point in time and does not allow you to keep track of changes through events.
public : IAsyncOperation<IVectorView<StorageFolder>> GetFoldersAsync(CommonFolderQuery query)public IAsyncOperation<IReadOnlyList<StorageFolder>> GetFoldersAsync(CommonFolderQuery query)Public Function GetFoldersAsync(query As CommonFolderQuery) As IAsyncOperation( Of IReadOnlyListStorageFolder )// You can use this method in JavaScript.
The type of folder query to perform.
When this method completes successfully, it returns a list (type IVectorView ) of folders of file groups that are represented by StorageFolder objects.
GetFoldersAsync(CommonFolderQuery, UInt32, UInt32) GetFoldersAsync(CommonFolderQuery, UInt32, UInt32) GetFoldersAsync(CommonFolderQuery, UInt32, UInt32) GetFoldersAsync(CommonFolderQuery, UInt32, UInt32)
Asynchronously retrieves a range of folders in this folder based on a folder query. This returns a snapshot of the folders or file groups at a point in time and does not allow you to keep track of changes through events.
public : IAsyncOperation<IVectorView<StorageFolder>> GetFoldersAsync(CommonFolderQuery query, unsigned int startIndex, unsigned int maxItemsToRetrieve)public IAsyncOperation<IReadOnlyList<StorageFolder>> GetFoldersAsync(CommonFolderQuery query, UInt32 startIndex, UInt32 maxItemsToRetrieve)Public Function GetFoldersAsync(query As CommonFolderQuery, startIndex As UInt32, maxItemsToRetrieve As UInt32) As IAsyncOperation( Of IReadOnlyListStorageFolder )// You can use this method in JavaScript.
The type of folder query to perform.
- startIndex
- unsigned int UInt32 UInt32 UInt32
The zero-based index of the first folder or file group in the range. This parameter defaults to 0.
- maxItemsToRetrieve
- unsigned int UInt32 UInt32 UInt32
The maximum number of folders or file groups to retrieve. Use -1 to retrieve all folders or file groups.
When this method completes successfully, it returns a list (type IVectorView ) of folders of file groups that are represented by StorageFolder objects.
Remarks
Use this overload to retrieve improve system performance by presenting a virtual view of the query results that includes only the necessary subset of folders.
- See Also
GetIndexedStateAsync() GetIndexedStateAsync() GetIndexedStateAsync() GetIndexedStateAsync()
Retrieves a value that indicates the indexed state of the StorageFolder location associated with the query.
public : IAsyncOperation<IndexedState> GetIndexedStateAsync()public IAsyncOperation<IndexedState> GetIndexedStateAsync()Public Function GetIndexedStateAsync() As IAsyncOperation( Of IndexedState )// You can use this method in JavaScript.
When this method completes successfully, it returns a value of the IndexedState enumeration.
- See Also
GetItemsAsync(UInt32, UInt32) GetItemsAsync(UInt32, UInt32) GetItemsAsync(UInt32, UInt32) GetItemsAsync(UInt32, UInt32)
Retrieves a list items like files, folders, or file groups, in a specified range (shallow enumeration).
public : IAsyncOperation<IVectorView<IStorageItem>> GetItemsAsync(unsigned int startIndex, unsigned int maxItemsToRetrieve)public IAsyncOperation<IReadOnlyList<IStorageItem>> GetItemsAsync(UInt32 startIndex, UInt32 maxItemsToRetrieve)Public Function GetItemsAsync(startIndex As UInt32, maxItemsToRetrieve As UInt32) As IAsyncOperation( Of IReadOnlyListIStorageItem )// You can use this method in JavaScript.
- startIndex
- unsigned int UInt32 UInt32 UInt32
The zero-based index of the first item in the range. This parameter defaults to 0.
- maxItemsToRetrieve
- unsigned int UInt32 UInt32 UInt32
The maximum number of items to retrieve. Use -1 to retrieve all items.
When this method completes successfully, it returns a list (type IVectorView ) of items. Each item is the IStorageItem type and represents a file, folder, or file group.
In this list, files are represented by StorageFile objects, and folders or file groups are represented by StorageFolder objects.
- See Also
IsCommonFileQuerySupported(CommonFileQuery) IsCommonFileQuerySupported(CommonFileQuery) IsCommonFileQuerySupported(CommonFileQuery) IsCommonFileQuerySupported(CommonFileQuery)
Verifies whether this folder supports the specified file query (returns true or false).
public : PlatForm::Boolean IsCommonFileQuerySupported(CommonFileQuery query)public bool IsCommonFileQuerySupported(CommonFileQuery query)Public Function IsCommonFileQuerySupported(query As CommonFileQuery) As bool// You can use this method in JavaScript.
The file query to test.
True if the folder supports the specified file query; otherwise false.
Remarks
Not all locations support all query options. Because files can be retrieved by the picker and you can't control the location, you can use this method to determine whether the location supports a particular query option.
Folders in a library or the HomeGroup support all query options. Other locations only support the following options:
- A shallow enumeration, such as CommonFileQuery.DefaultQuery or CommonFolderQuery.DefaultQuery, or a QueryOptions class that was created with no constructor arguments.
- A deep, flat list of files sorted by name, such as CommonFileQuery.orderByName or the equivalent QueryOptions class.
- A deep, flat list of files sorted by search rank, such as CommonFileQuery.orderBySearchRank or the equivalent QueryOptions class.
IsCommonFolderQuerySupported(CommonFolderQuery) IsCommonFolderQuerySupported(CommonFolderQuery) IsCommonFolderQuerySupported(CommonFolderQuery) IsCommonFolderQuerySupported(CommonFolderQuery)
Verifies whether this folder supports the specified folder query (returns true or false).
public : PlatForm::Boolean IsCommonFolderQuerySupported(CommonFolderQuery query)public bool IsCommonFolderQuerySupported(CommonFolderQuery query)Public Function IsCommonFolderQuerySupported(query As CommonFolderQuery) As bool// You can use this method in JavaScript.
The folder query to test.
True if the folder supports the specified folder query; otherwise false.
Remarks
Not all locations support all query options, for more detail refer to IsCommonFileQuerySupported.