IStorageFolderQueryOperations IStorageFolderQueryOperations IStorageFolderQueryOperations IStorageFolderQueryOperations Interface

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 CommonFolderQuery.

Syntax

Declaration

public interface IStorageFolderQueryOperationspublic interface IStorageFolderQueryOperationsPublic Interface IStorageFolderQueryOperations

Methods summary

Verifies whether the folder supports the specified search query options (returns true or false).

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.

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.

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.

Retrieves an object for enumerating folders in a storage location and subscribing to events that fire when the contents of the storage location change.

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.

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.

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.

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.

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.

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.

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.

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.

Retrieves a value that indicates the indexed state of the StorageFolder location associated with the query.

Retrieves a list items like files, folders, or file groups, in a specified range (shallow enumeration).

Verifies whether this folder supports the specified file query (returns true or false).

Verifies whether this folder supports the specified folder query (returns true or false).

Methods

  • AreQueryOptionsSupported(Windows.Storage.Search.QueryOptions)
    AreQueryOptionsSupported(Windows.Storage.Search.QueryOptions)
    AreQueryOptionsSupported(Windows.Storage.Search.QueryOptions)
    AreQueryOptionsSupported(Windows.Storage.Search.QueryOptions)

    Verifies whether the folder supports the specified search query options (returns true or false).

    public bool AreQueryOptionsSupported(Windows.Storage.Search.QueryOptions queryOptions)public bool AreQueryOptionsSupported(Windows.Storage.Search.QueryOptions queryOptions)Public Function AreQueryOptionsSupported(queryOptions As Windows.Storage.Search.QueryOptions) As bool

    Parameters

    Returns

    • bool
      bool
      bool
      bool

      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:

  • 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

    Returns

  • CreateFileQuery(Windows.Storage.Search.CommonFileQuery)
    CreateFileQuery(Windows.Storage.Search.CommonFileQuery)
    CreateFileQuery(Windows.Storage.Search.CommonFileQuery)
    CreateFileQuery(Windows.Storage.Search.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(Windows.Storage.Search.CommonFileQuery query)public StorageFileQueryResult CreateFileQuery(Windows.Storage.Search.CommonFileQuery query)Public Function CreateFileQuery(query As Windows.Storage.Search.CommonFileQuery) As StorageFileQueryResult

    Parameters

    Returns

  • CreateFileQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateFileQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateFileQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateFileQueryWithOptions(Windows.Storage.Search.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(Windows.Storage.Search.QueryOptions queryOptions)public StorageFileQueryResult CreateFileQueryWithOptions(Windows.Storage.Search.QueryOptions queryOptions)Public Function CreateFileQueryWithOptions(queryOptions As Windows.Storage.Search.QueryOptions) As StorageFileQueryResult

    Parameters

    Returns

  • 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

    Returns

  • CreateFolderQuery(Windows.Storage.Search.CommonFolderQuery)
    CreateFolderQuery(Windows.Storage.Search.CommonFolderQuery)
    CreateFolderQuery(Windows.Storage.Search.CommonFolderQuery)
    CreateFolderQuery(Windows.Storage.Search.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(Windows.Storage.Search.CommonFolderQuery query)public StorageFolderQueryResult CreateFolderQuery(Windows.Storage.Search.CommonFolderQuery query)Public Function CreateFolderQuery(query As Windows.Storage.Search.CommonFolderQuery) As StorageFolderQueryResult

    Parameters

    Returns

  • CreateFolderQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateFolderQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateFolderQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateFolderQueryWithOptions(Windows.Storage.Search.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(Windows.Storage.Search.QueryOptions queryOptions)public StorageFolderQueryResult CreateFolderQueryWithOptions(Windows.Storage.Search.QueryOptions queryOptions)Public Function CreateFolderQueryWithOptions(queryOptions As Windows.Storage.Search.QueryOptions) As StorageFolderQueryResult

    Parameters

    Returns

    Remarks

    You can use QueryOptions and CreateFileQueryWithOptions(Windows.Storage.Search.QueryOptions) 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

    Returns

  • CreateItemQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateItemQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateItemQueryWithOptions(Windows.Storage.Search.QueryOptions)
    CreateItemQueryWithOptions(Windows.Storage.Search.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(Windows.Storage.Search.QueryOptions queryOptions)public StorageItemQueryResult CreateItemQueryWithOptions(Windows.Storage.Search.QueryOptions queryOptions)Public Function CreateItemQueryWithOptions(queryOptions As Windows.Storage.Search.QueryOptions) As StorageItemQueryResult

    Parameters

    Returns

    Remarks

    Don't set FolderDepth to FolderDepth; deep queries do not work if you are querying files in a Digital Living Network Alliance (DLNA) device.

  • GetFilesAsync(Windows.Storage.Search.CommonFileQuery)
    GetFilesAsync(Windows.Storage.Search.CommonFileQuery)
    GetFilesAsync(Windows.Storage.Search.CommonFileQuery)
    GetFilesAsync(Windows.Storage.Search.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<StorageFile>> GetFilesAsync(Windows.Storage.Search.CommonFileQuery query)public IAsyncOperation<StorageFile>> GetFilesAsync(Windows.Storage.Search.CommonFileQuery query)Public Function GetFilesAsync(query As Windows.Storage.Search.CommonFileQuery) As IAsyncOperation( Of StorageFile )

    Parameters

    Returns

    • When this method completes successfully, it returns a list (type IVectorView<T> ) of files that are represented by StorageFile objects.

  • GetFilesAsync(Windows.Storage.Search.CommonFileQuery,System.UInt32,System.UInt32)
    GetFilesAsync(Windows.Storage.Search.CommonFileQuery,System.UInt32,System.UInt32)
    GetFilesAsync(Windows.Storage.Search.CommonFileQuery,System.UInt32,System.UInt32)
    GetFilesAsync(Windows.Storage.Search.CommonFileQuery,System.UInt32,System.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<StorageFile>> GetFilesAsync(Windows.Storage.Search.CommonFileQuery query,System.UInt32 startIndex,System.UInt32 maxItemsToRetrieve)public IAsyncOperation<StorageFile>> GetFilesAsync(Windows.Storage.Search.CommonFileQuery query,System.UInt32 startIndex,System.UInt32 maxItemsToRetrieve)Public Function GetFilesAsync(query As Windows.Storage.Search.CommonFileQuery,startIndex As System.UInt32,maxItemsToRetrieve As System.UInt32) As IAsyncOperation( Of StorageFile )

    Parameters

    • query

      The type of file query to perform.

    • startIndex
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The zero-based index of the first file in the range. This parameter defaults to 0.

    • maxItemsToRetrieve
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The maximum number of files to retrieve. Use -1 to retrieve all files.

    Returns

    • When this method completes successfully, it returns a list (type IVectorView<T> ) 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(Windows.Storage.Search.CommonFolderQuery)
    GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery)
    GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery)
    GetFoldersAsync(Windows.Storage.Search.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<StorageFolder>> GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery query)public IAsyncOperation<StorageFolder>> GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery query)Public Function GetFoldersAsync(query As Windows.Storage.Search.CommonFolderQuery) As IAsyncOperation( Of StorageFolder )

    Parameters

    Returns

    • When this method completes successfully, it returns a list (type IVectorView<T> ) of folders of file groups that are represented by StorageFolder objects.

  • GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery,System.UInt32,System.UInt32)
    GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery,System.UInt32,System.UInt32)
    GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery,System.UInt32,System.UInt32)
    GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery,System.UInt32,System.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<StorageFolder>> GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery query,System.UInt32 startIndex,System.UInt32 maxItemsToRetrieve)public IAsyncOperation<StorageFolder>> GetFoldersAsync(Windows.Storage.Search.CommonFolderQuery query,System.UInt32 startIndex,System.UInt32 maxItemsToRetrieve)Public Function GetFoldersAsync(query As Windows.Storage.Search.CommonFolderQuery,startIndex As System.UInt32,maxItemsToRetrieve As System.UInt32) As IAsyncOperation( Of StorageFolder )

    Parameters

    • query

      The type of folder query to perform.

    • startIndex
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The zero-based index of the first folder or file group in the range. This parameter defaults to 0.

    • maxItemsToRetrieve
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The maximum number of folders or file groups to retrieve. Use -1 to retrieve all folders or file groups.

    Returns

    • When this method completes successfully, it returns a list (type IVectorView<T> ) 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.

  • 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 )

    Returns

    • When this method completes successfully, it returns a value of the IndexedState enumeration.

  • GetItemsAsync(System.UInt32,System.UInt32)
    GetItemsAsync(System.UInt32,System.UInt32)
    GetItemsAsync(System.UInt32,System.UInt32)
    GetItemsAsync(System.UInt32,System.UInt32)

    Retrieves a list items like files, folders, or file groups, in a specified range (shallow enumeration).

    public IAsyncOperation<IStorageItem>> GetItemsAsync(System.UInt32 startIndex,System.UInt32 maxItemsToRetrieve)public IAsyncOperation<IStorageItem>> GetItemsAsync(System.UInt32 startIndex,System.UInt32 maxItemsToRetrieve)Public Function GetItemsAsync(startIndex As System.UInt32,maxItemsToRetrieve As System.UInt32) As IAsyncOperation( Of IStorageItem )

    Parameters

    • startIndex
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The zero-based index of the first item in the range. This parameter defaults to 0.

    • maxItemsToRetrieve
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The maximum number of items to retrieve. Use -1 to retrieve all items.

    Returns

    • When this method completes successfully, it returns a list (type IVectorView<T> ) 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.

  • IsCommonFileQuerySupported(Windows.Storage.Search.CommonFileQuery)
    IsCommonFileQuerySupported(Windows.Storage.Search.CommonFileQuery)
    IsCommonFileQuerySupported(Windows.Storage.Search.CommonFileQuery)
    IsCommonFileQuerySupported(Windows.Storage.Search.CommonFileQuery)

    Verifies whether this folder supports the specified file query (returns true or false).

    public bool IsCommonFileQuerySupported(Windows.Storage.Search.CommonFileQuery query)public bool IsCommonFileQuerySupported(Windows.Storage.Search.CommonFileQuery query)Public Function IsCommonFileQuerySupported(query As Windows.Storage.Search.CommonFileQuery) As bool

    Parameters

    Returns

    • bool
      bool
      bool
      bool

      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:

  • IsCommonFolderQuerySupported(Windows.Storage.Search.CommonFolderQuery)
    IsCommonFolderQuerySupported(Windows.Storage.Search.CommonFolderQuery)
    IsCommonFolderQuerySupported(Windows.Storage.Search.CommonFolderQuery)
    IsCommonFolderQuerySupported(Windows.Storage.Search.CommonFolderQuery)

    Verifies whether this folder supports the specified folder query (returns true or false).

    public bool IsCommonFolderQuerySupported(Windows.Storage.Search.CommonFolderQuery query)public bool IsCommonFolderQuerySupported(Windows.Storage.Search.CommonFolderQuery query)Public Function IsCommonFolderQuerySupported(query As Windows.Storage.Search.CommonFolderQuery) As bool

    Parameters

    Returns

    • bool
      bool
      bool
      bool

      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(Windows.Storage.Search.CommonFileQuery).

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.GuidAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Storage.Search.dll