ContentPrefetchTrigger 类

定义

提供在预提取 Web 资源时运行自定义处理程序的功能。

public ref class ContentPrefetchTrigger sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class ContentPrefetchTrigger final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class ContentPrefetchTrigger final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class ContentPrefetchTrigger
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ContentPrefetchTrigger
function ContentPrefetchTrigger(waitInterval)
Public NotInheritable Class ContentPrefetchTrigger
继承
Object Platform::Object IInspectable ContentPrefetchTrigger
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

开发人员可以附加处理程序来预加载和缓存 Web 内容,以便应用可以启动并刷新其内容并使其保持最新状态。 访问缓存内容有助于减少应用激活时间,因为无需将昂贵的 Web 请求排队。

除了自定义任务外,现有的 ContentPrefetcher API 仍然可用,当先决条件工作仅涉及从固定或动态 URI 集预加载和缓存内容时,可以使用它代替自定义任务。

构造函数

ContentPrefetchTrigger()

初始化 ContentPrefetchTrigger 类的新实例。

ContentPrefetchTrigger(TimeSpan)

使用指定的时间间隔初始化 ContentPrefetchTrigger 类的新实例。

属性

WaitInterval

检索预提取 Web 内容的时间间隔。

适用于

另请参阅