WebUICachedFileUpdaterActivatedEventArgs 类

定义

提供有关用户保存或打开需要应用更新的文件时触发的已激活事件的信息。

C#/C++/VB 此类型显示为 CachedFileUpdaterActivatedEventArgs

public ref class WebUICachedFileUpdaterActivatedEventArgs sealed : ICachedFileUpdaterActivatedEventArgs, IActivatedEventArgsDeferral
public ref class WebUICachedFileUpdaterActivatedEventArgs sealed : IActivatedEventArgsWithUser, ICachedFileUpdaterActivatedEventArgs, IActivatedEventArgsDeferral
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WebUICachedFileUpdaterActivatedEventArgs final : ICachedFileUpdaterActivatedEventArgs, IActivatedEventArgsDeferral
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WebUICachedFileUpdaterActivatedEventArgs final : IActivatedEventArgsWithUser, ICachedFileUpdaterActivatedEventArgs, IActivatedEventArgsDeferral
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WebUICachedFileUpdaterActivatedEventArgs : ICachedFileUpdaterActivatedEventArgs, IActivatedEventArgsDeferral
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WebUICachedFileUpdaterActivatedEventArgs : IActivatedEventArgsWithUser, ICachedFileUpdaterActivatedEventArgs, IActivatedEventArgsDeferral
Public NotInheritable Class WebUICachedFileUpdaterActivatedEventArgs
Implements IActivatedEventArgsDeferral, ICachedFileUpdaterActivatedEventArgs
Public NotInheritable Class WebUICachedFileUpdaterActivatedEventArgs
Implements IActivatedEventArgsDeferral, IActivatedEventArgsWithUser, ICachedFileUpdaterActivatedEventArgs
继承
Object Platform::Object IInspectable WebUICachedFileUpdaterActivatedEventArgs
属性
实现

Windows 要求

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

示例

文件选取器协定示例演示如何响应 cachedFileUpdater 激活事件。

// cachedFileUpdater activated event handler
function activated(eventObject) {
        // Identify whether app was launched for cachedFileUpdater
        if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.cachedFileUpdater) {
            // Perform tasks to prepare your app to display its file picker page

            // Get file picker UI
            cachedFileUpdaterUI = eventObject.detail.cachedFileUpdaterUI;

            cachedFileUpdaterUI.addEventListener("fileupdaterequested", onFileUpdateRequest);
            cachedFileUpdaterUI.addEventListener("uirequested", onUIRequested);

            switch (cachedFileUpdaterUI.updateTarget) {
                case Windows.Storage.Provider.CachedFileTarget.local:
                    scenarios = [{ url: "/html/cachedFileUpdaterScenario1.html", title: "Get latest version" }];
                    break;
                case Windows.Storage.Provider.CachedFileTarget.remote:
                    scenarios = [{ url: "/html/cachedFileUpdaterScenario2.html", title: "Remote file update" }];
                    break;
            }
            SdkSample.scenarios = scenarios;
        }
    }

// Register the activated event handler
WinJS.Application.addEventListener("activated", activated, false);

对于 JavaScript, eventObject 包含 webUICachedFileUpdaterActivatedEventArgs 对象。

注解

若要详细了解如何为应用提供的文件提供更新 ,请参阅快速入门:通过 Windows.Storage.Pickers.Provider 命名空间参考提供文件服务。

CachedFileUpdater 中实现 WinJS.Application.OnactivatedWindows.UI.WebUI.WebUIApplication.activated 事件的事件处理程序时,将访问此对象。

注意

此类不敏捷,这意味着需要考虑其线程模型和封送处理行为。 有关详细信息,请参阅 线程处理和封送处理 (C++/CX)

版本历史记录

Windows 版本 SDK 版本 已添加值
1607 14393 User

属性

ActivatedOperation

获取应用激活的操作。

CachedFileUpdaterUI

获取文件选取器在需要应用更新时显示的信箱 UI。

Kind

获取激活类型。

PreviousExecutionState

获取应用在激活前的执行状态。

SplashScreen

获取初始屏幕对象,该对象提供有关从初始屏幕过渡到激活的应用的信息。

User

获取为其激活应用的用户。

适用于

另请参阅