共用方式為


StorageFolderQueryResult.FindStartIndexAsync(Object) 方法

定義

從最符合指定屬性值的查詢結果擷取資料夾的索引。 相符的屬性是由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中的 屬性。

傳回

IAsyncOperation<UInt32>

Windows.Foundation.IAsyncOperation

IAsyncOperation<uint32_t>

當此方法成功完成時,它會傳回查詢結果中相符資料夾的索引;否則會傳回 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);

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

適用於