StorageFileQueryResult 클래스

정의

StorageFolder 개체가 나타내는 위치에 있는 파일 쿼리 결과에 대한 액세스를 제공합니다. StorageFileQueryResult를 사용하여 해당 StorageFolder 위치의 파일을 열거할 수 있습니다.

public ref class StorageFileQueryResult sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class StorageFileQueryResult final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class StorageFileQueryResult
Public NotInheritable Class StorageFileQueryResult
상속
Object Platform::Object IInspectable StorageFileQueryResult
특성
구현

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

이 예제에서는 StorageFileQueryResult 개체에서 파일 목록을 가져오는 방법을 보여 줍니다.

// Set query options with filter and sort order for results
List<string> fileTypeFilter = new List<string>();
fileTypeFilter.Add(".jpg");
fileTypeFilter.Add(".png");
fileTypeFilter.Add(".bmp");
fileTypeFilter.Add(".gif");
var queryOptions = new QueryOptions(CommonFileQuery.OrderByName, fileTypeFilter);

// Create query and retrieve files
var query = KnownFolders.PicturesLibrary.CreateFileQueryWithOptions(queryOptions);
IReadOnlyList<StorageFile> fileList = await query.GetFilesAsync();
// Process results
foreach (StorageFile file in fileList)
{
    // Process file
}

변수는 query 쿼리 조건을 충족하는 파일을 검색하는 데 사용되는 StorageFileQueryResult를 가져옵니다.

참고

KnownFolders.PicturesLibrary를 사용하여 라이브러리에 액세스하려면 사진 라이브러리 기능이 필요합니다. 기능 및 파일 액세스에 대한 자세한 내용은 파일 액세스 권한을 참조하세요.

설명

참고

로 특성화 marshalling_behavior(agile)되지는 않지만 이 클래스는 Agile로 처리할 수 있습니다.

StorageFolder 또는 FolderInformation 개체에서 다음 메서드를 호출하여 StorageFileQueryResult 개체를 가져올 수 있습니다.

속성

Folder

StorageFileQueryResult 개체를 만들기 위해 쿼리된 폴더를 가져옵니다. 이 폴더는 쿼리의 scope 나타냅니다.

메서드

ApplyNewQueryOptions(QueryOptions)

QueryOptions에 따라 쿼리 결과를 수정합니다.

FindStartIndexAsync(Object)

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

GetCurrentQueryOptions()

쿼리 결과를 확인하는 데 사용되는 쿼리 옵션을 검색합니다.

GetFilesAsync()

쿼리 결과 집합의 모든 파일 목록을 검색합니다.

GetFilesAsync(UInt32, UInt32)

지정된 범위의 파일 목록을 검색합니다.

GetItemCountAsync()

쿼리 결과 집합의 파일 수를 검색합니다.

GetMatchingPropertiesWithRanges(StorageFile)

해당 텍스트 범위와 일치하는 파일 속성을 가져옵니다.

이벤트

ContentsChanged

쿼리할 폴더에서 파일이 추가, 삭제 또는 수정될 때 발생합니다. 이 이벤트는 GetFilesAsync 가 한 번 이상 호출된 후에만 발생합니다.

OptionsChanged

쿼리 옵션이 변경되면 발생합니다.

적용 대상

추가 정보