GameSaveContainer.ReadAsync(IMapView<String,IBuffer>) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從此容器讀取 Blob,如 blobsToRead所指定。 傳入 blobsToRead 的緩衝區必須夠大,才能儲存 Blob 資料。
public:
virtual IAsyncOperation<GameSaveOperationResult ^> ^ ReadAsync(IMapView<Platform::String ^, IBuffer ^> ^ blobsToWrite) = ReadAsync;
public:
virtual IAsyncOperation<GameSaveOperationResult ^> ^ ReadAsync(IMapView<Platform::String ^, IBuffer ^> ^ blobsToRead) = ReadAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<GameSaveOperationResult> ReadAsync(IMapView<winrt::hstring, IBuffer const&> const& blobsToWrite);
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<GameSaveOperationResult> ReadAsync(IMapView<winrt::hstring, IBuffer const&> const& blobsToRead);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<GameSaveOperationResult> ReadAsync(IReadOnlyDictionary<string,IBuffer> blobsToWrite);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<GameSaveOperationResult> ReadAsync(IReadOnlyDictionary<string,IBuffer> blobsToRead);
function readAsync(blobsToWrite)
function readAsync(blobsToRead)
Public Function ReadAsync (blobsToWrite As IReadOnlyDictionary(Of String, IBuffer)) As IAsyncOperation(Of GameSaveOperationResult)
Public Function ReadAsync (blobsToRead As IReadOnlyDictionary(Of String, IBuffer)) As IAsyncOperation(Of GameSaveOperationResult)
參數
傳回
類型: IAsyncOperation < ;GameSaveOperationResult > ;
IAsyncOperation < ;GameSaveOperationResult > ; 代表非同步作業的狀態。
- 屬性
備註
使用 GameSaveBlobInfoQuery 來判斷每個所要求的遊戲儲存 Blob 所需的緩衝區大小。
如果作業順利完成,傳回緩衝區的 length 屬性會指定每個緩衝區中包含的資料量。
ReadAsync 與 GetAsync 不同,因為 GetAsync 會自動為 Blob 資料配置必要的緩衝區,並在 GameSaveBlobGetResult 物件中傳回該資料。 ReadAsync 會改為直接寫入 BlobsToRead 參數中傳遞的緩衝區。
非同步作業完成之後,請檢查結果的 Status 屬性,以判斷作業是否成功與 GameSaveErrorStatus.Ok。