This topic has not yet been rated - Rate this topic

StorageFileQueryResult.FindStartIndexAsync | findStartIndexAsync method

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.

Syntax


public IAsyncOperation<uint> FindStartIndexAsync(
  object value
)

Parameters

value

Type: Object [JavaScript] | System.Object [.NET] | Platform::Object [C++]

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.

Return value

Type: IAsyncOperation<UInt32>

When this method completes successfully it returns the index of the matched file 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. To learn about SemanticZoom in JavaScript, see Quickstart: adding SemanticZoom controls. To learn about SemanticZoom in C#/C++/VB, see Quickstart: adding SemanticZoom controls.

Windows Phone 8

This API is not implemented and will throw an exception if called.

Examples

This example shows how to find the first song in an album that has a title beginning with the "R" in a set of query results that contains songs grouped by album 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);

StorageFileQueryResult queryResult = musicFolder.CreateFileQueryWithOptions(queryOptions);
var firstIndex = await queryResult.FindStartIndexAsync("R");

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage.Search
Windows::Storage::Search [C++]

Metadata

Windows.winmd

See also

StorageFileQueryResult

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.