共用方式為


FeedResourceResponse 類別

定義

表示透過 IFeedResourceProvider.OnResourceRequested 實作所接收之資源要求的回應。

public ref class FeedResourceResponse sealed
/// [Windows.Foundation.Metadata.Activatable(Microsoft.Windows.Widgets.Feeds.Providers.IFeedResourceResponseFactory, 327680, "Microsoft.Windows.Widgets.WidgetContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.Widgets.WidgetContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class FeedResourceResponse final
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.Windows.Widgets.Feeds.Providers.IFeedResourceResponseFactory), 327680, "Microsoft.Windows.Widgets.WidgetContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.Widgets.WidgetContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class FeedResourceResponse
function FeedResourceResponse(content, reasonPhrase, statusCode)
Public NotInheritable Class FeedResourceResponse
繼承
Object Platform::Object IInspectable FeedResourceResponse
屬性

備註

摘要提供者可以透過 FeedResourceRequestedArgs.Request 屬性存取資源要求,並將 FeedResourceRequestedArgs.Response 屬性設定為包含資源資料流的 FeedResourceResponse ,然後傳回。

如果評估或資源無法立即使用,提供者應該呼叫 FeedResourceRequestedArgs.GetDeferral來要求延遲,起始背景工作,並在資源可用時完成延遲。

如果提供者傳回 OnResourceRequested 呼叫而不設定 FeedResourceRequestedArgs.Response 屬性,則會進行 Web 提取。 在沒有 FeedResourceResponse 的情況下傳回時,提供者可能會修改 Headers 集合,供 Web 擷取使用。

建構函式

FeedResourceResponse(IRandomAccessStreamReference, String, Int32)

初始化 FeedResourceResponse 類別的新實例。

屬性

Content

取得包含要求之資源的內容數據流。

Headers

取得或設定標頭值的選擇性字典,這些標頭值可能已由摘要提供者從 Web 要求傳回。

ReasonPhrase

取得不是使用者面向之結果的文字描述。

StatusCode

取得回應的 HTTP 狀態代碼。

適用於