StorageFileQueryResult.FindStartIndexAsync(Object) 메서드

정의

지정된 속성 값(또는 FileActivatedEventArgs.NeighboringFilesQuery와 함께 사용되는 경우 파일)과 가장 일치하는 쿼리 결과에서 파일의 인덱스를 검색합니다. 일치하는 속성은 QueryOptions.SortOrder 목록의 첫 번째 SortEntry에 의해 결정됩니다.

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)

매개 변수

value
Object

Platform::Object

IInspectable

쿼리 결과를 검색할 때 일치시킬 속성 값입니다. 이 값을 일치시키는 데 사용되는 의 속성은 QueryOptions.SortOrder 목록의 첫 번째 SortEntry에 있는 속성입니다.

또는 FileActivatedEventArgs.NeighboringFilesQuery를 사용하여 검색할 때 일치시킬 파일입니다.

반환

IAsyncOperation<UInt32>

Windows.Foundation.IAsyncOperation

IAsyncOperation<uint32_t>

이 메서드가 성공적으로 완료되면 쿼리 결과에서 일치하는 파일의 인덱스 또는 FileActivatedEventArgs.NeighboringFilesQuery에 있는 파일의 인덱스를 반환합니다. 후자의 경우 파일은 FileActivatedEventArgs.Files에서 원본이 될 것으로 예상됩니다. 이 함수가 실패하면 uint를 반환합니다 . MaxValue.

구현

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

예제

이 예제에서는 앨범 제목별로 그룹화된 노래가 포함된 쿼리 결과 집합에서 제목이 "R"로 시작하는 앨범의 첫 번째 노래를 찾는 방법을 보여 줍니다.

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");

설명

이 메서드를 FileActivatedEventArgs.NeighboringFilesQuery 와 함께 사용하여 원래 보기의 정렬 순서를 유지하면서 인접 파일 간을 반복할 수 있습니다.

적용 대상