IStorageQueryResultBase IStorageQueryResultBase IStorageQueryResultBase IStorageQueryResultBase Interface

Definition

Provides methods to access to and manage query results.

public : interface IStorageQueryResultBase
public interface IStorageQueryResultBase
Public Interface IStorageQueryResultBase
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Folder Folder Folder Folder

Gets the folder originally used to create a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object. This folder represents the scope of the query.

public : StorageFolder Folder { get; }
public StorageFolder Folder { get; }
Public ReadOnly Property Folder As StorageFolder
var storageFolder = iStorageQueryResultBase.folder;

Methods

ApplyNewQueryOptions(QueryOptions) ApplyNewQueryOptions(QueryOptions) ApplyNewQueryOptions(QueryOptions) ApplyNewQueryOptions(QueryOptions)

Applies new query options to the results retrieved by the StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public : void ApplyNewQueryOptions(QueryOptions newQueryOptions)
public void ApplyNewQueryOptions(QueryOptions newQueryOptions)
Public Function ApplyNewQueryOptions(newQueryOptions As QueryOptions) As void
iStorageQueryResultBase.applyNewQueryOptions(newQueryOptions);
Parameters
newQueryOptions
QueryOptions QueryOptions QueryOptions QueryOptions

The new query options.

Remarks

When this method returns, the contents of the query and the count of items reflect the new query options.

This method causes the OptionsChanged event to fire.

FindStartIndexAsync(Object) FindStartIndexAsync(Object) FindStartIndexAsync(Object) FindStartIndexAsync(Object)

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.

public : IAsyncOperation<unsigned int> FindStartIndexAsync(Platform::Object value)
public IAsyncOperation<uint> FindStartIndexAsync(Object value)
Public Function FindStartIndexAsync(value As Object) As IAsyncOperation( Of uint )
Windows.Storage.Search.IStorageQueryResultBase.findStartIndexAsync(value).done( /* Your success and error handlers */ );
Parameters
value
Platform::Object Object Object Object

The property value to match when searching the query results.

Returns

When this method completes successfully it returns the index of the matched item in the query results.

Remarks

You can use this index in conjunction with Semantic Zoom to determine where the page should be zoomed in after the user selects the Semantic Zoom control.

GetCurrentQueryOptions() GetCurrentQueryOptions() GetCurrentQueryOptions() GetCurrentQueryOptions()

Retrieves the query options used to create a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public : QueryOptions GetCurrentQueryOptions()
public QueryOptions GetCurrentQueryOptions()
Public Function GetCurrentQueryOptions() As QueryOptions
var queryOptions = iStorageQueryResultBase.getCurrentQueryOptions();
Returns

GetItemCountAsync() GetItemCountAsync() GetItemCountAsync() GetItemCountAsync()

Retrieves the number of items that match the query that created a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public : IAsyncOperation<unsigned int> GetItemCountAsync()
public IAsyncOperation<uint> GetItemCountAsync()
Public Function GetItemCountAsync() As IAsyncOperation( Of uint )
Windows.Storage.Search.IStorageQueryResultBase.getItemCountAsync().done( /* Your success and error handlers */ );
Returns

When this method completes successfully, it returns the number of items that match the query.

Events

ContentsChanged ContentsChanged ContentsChanged ContentsChanged

Fires when an item is added, deleted or modified in the folder being queried.

public : event TypedEventHandler ContentsChanged<IStorageQueryResultBase, object>
public event TypedEventHandler ContentsChanged<IStorageQueryResultBase, object>
Public Event TypedEventHandler ContentsChanged( Of ( Of IStorageQueryResultBase ), ( Of object ))
function onContentsChanged(eventArgs){/* Your code */}


iStorageQueryResultBase.addEventListener("contentsChanged", onContentsChanged);
iStorageQueryResultBase.removeEventListener("contentsChanged", onContentsChanged);

Remarks

If you register a handler for this event, keep that handler registered while you suspend your app (in response to oncheckpoint or Suspending ). Your app will not receive ContentsChanged events while it is suspended and when your app resumes it will receive a single event that aggregates all of the changes if any occurred.

Additionally, keep in mind that registering and removing event handlers are synchronous operations and might cause your app to stop responding briefly if you execute them on your app's UI thread. Wherever possible, use a thread other than your app's UI thread to register and unregister these event handlers.

OptionsChanged OptionsChanged OptionsChanged OptionsChanged

Fires when the query options are changed for a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public : event TypedEventHandler OptionsChanged<IStorageQueryResultBase, object>
public event TypedEventHandler OptionsChanged<IStorageQueryResultBase, object>
Public Event TypedEventHandler OptionsChanged( Of ( Of IStorageQueryResultBase ), ( Of object ))
function onOptionsChanged(eventArgs){/* Your code */}


iStorageQueryResultBase.addEventListener("optionsChanged", onOptionsChanged);
iStorageQueryResultBase.removeEventListener("optionsChanged", onOptionsChanged);