StorageFileQueryResult class
Provides access to the results of a query of the files in the location that is represented by a storageFolder object. You can use storageFileQueryResult to enumerate the files in that storageFolder location.
Syntax
Public NotInheritable Class StorageFileQueryResult Inherits Object Implements IStorageQueryResultBase
Attributes
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The StorageFileQueryResult class has these types of members:
Events
The StorageFileQueryResult class has these events.
| Event | Description |
|---|---|
| ContentsChanged | Fires when a file is added to, deleted from, or modified in the folder being queried. |
| OptionsChanged | Fires when the query options change. |
Methods
The StorageFileQueryResult class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| ApplyNewQueryOptions | Modifies query results based on new QueryOptions. |
| FindStartIndexAsync | Retrieves the index of the file from the query results that most closely matches the specified property value. The property that is matched is determined by the first SortEntry of the QueryOptions.SortOrder list. |
| GetCurrentQueryOptions | Retrieves the query options used to determine query results. |
| GetFilesAsync() | Retrieves a list of all the files in the query result set. |
| GetFilesAsync(UInt32, UInt32) | Retrieves a list of files in a specified range. |
| GetItemCountAsync | Retrieves the number of files in the set of query results. |
Properties
The StorageFileQueryResult class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the folder that was queried to create the StorageFileQueryResult object. This folder represents the scope of the query. |
Remarks
You can get a storageFileQueryResult object by calling the following methods from a storageFolder or a folderInformation object:
- storageFolder.createFileQuery methods
- storageFolder.createFileQueryWithOptions method
- folderInformation.createFileQuery methods
- folderInformation.createFileQueryWithOptions
For more code examples that show you how to use storageFileQueryResult objects, see the Folder enumeration sample and the File system search sample.
Windows Phone 8
This API is not implemented and will throw an exception if called.
Examples
This example demonstrates how to get a list of files from a storageFileQueryResult object.
The query variable gets the storageFileQueryResult that is used to retrieve files that meet the criteria of the query.
Note You need the Pictures library capability to access the library using KnownFolders.PicturesLibrary. To learn more about capabilities and file access, see File access and permissions in Windows Store app.
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- Windows.Storage.storageFolder.createFileQuery methods
- Windows.Storage.storageFolder.createFileQueryWithOptions method
- Windows.Storage.BulkAccess.folderInformation.createFileQuery
- Windows.Storage.BulkAccess.folderInformation.createFileQueryWithOptions
Build date: 2/25/2013