FeedResourceResponse 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示对通过 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
- 继承
- 属性
注解
源提供程序可以通过 FeedResourceRequestedArgs.Request 属性访问资源请求,并将 FeedResourceRequestedArgs.Response 属性设置为包含到资源的流的 FeedResourceResponse ,然后返回。
如果评估或资源不能立即可用,提供程序应通过调用 FeedResourceRequestedArgs.GetDeferral 请求延迟,启动后台任务,并在资源可用时完成延迟。
如果提供程序在未设置 FeedResourceRequestedArgs.Response 属性的情况下返回 OnResourceRequested 调用,则将进行 Web 提取。 返回时没有 FeedResourceResponse 时,提供程序可能会修改 Headers 集合,Web 提取将使用该集合。
构造函数
FeedResourceResponse(IRandomAccessStreamReference, String, Int32) |
初始化 FeedResourceResponse 类的新实例。 |
属性
Content |
获取包含所请求资源的内容流。 |
Headers |
获取或设置可能已由源提供程序从 Web 请求返回的标头值的可选字典。 |
ReasonPhrase |
获取不是面向用户的结果的文本说明。 |
StatusCode |
获取响应的 HTTP 状态代码。 |
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈