Jaa


StorageFolderQueryResult.FindStartIndexAsync(Object) Method

Definition

Retrieves the index of the folder 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:
 virtual IAsyncOperation<unsigned int> ^ FindStartIndexAsync(Platform::Object ^ value) = FindStartIndexAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<uint32_t> FindStartIndexAsync(IInspectable const& value);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<uint> FindStartIndexAsync(object value);
function findStartIndexAsync(value)
Public Function FindStartIndexAsync (value As Object) As IAsyncOperation(Of UInteger)

Parameters

value
Object

Platform::Object

IInspectable

The property value to match when searching the query results. The property to that is used to match this value is the property in the first SortEntry of the QueryOptions.SortOrder list.

Returns

IAsyncOperation<UInt32>

Windows.Foundation.IAsyncOperation<unsigned int>

IAsyncOperation<uint32_t>

When this method completes successfully it returns the index of the matched folder in the query results; otherwise it returns uint.MaxValue.

Implements

M:Windows.Storage.Search.IStorageQueryResultBase.FindStartIndexAsync(System.Object) M:Windows.Storage.Search.IStorageQueryResultBase.FindStartIndexAsync(Platform::Object) M:Windows.Storage.Search.IStorageQueryResultBase.FindStartIndexAsync(IInspectable)
Attributes

Examples

This example shows how to find the first album that has a title that begins with an "R" in a set of query results that contains albums sorted by title.

QueryOptions queryOptions = new QueryOptions();
queryOptions.FolderDepth = FolderDepth.Deep;
queryOptions.IndexerOption = IndexerOption.OnlyUseIndexer;
SortEntry album = new SortEntry();
album.AscendingOrder = true;
album.PropertyName = "System.Music.AlbumTitle";
queryOptions.SortOrder.Add(album);

StorageFolderQueryResult queryResult = musicFolder.CreateFolderQueryWithOptions(queryOptions);
var firstIndex = await queryResult.FindStartIndexAsync("R");

Applies to