WebUIFileOpenPickerActivatedEventArgs 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public ref class WebUIFileOpenPickerActivatedEventArgs sealed : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
public ref class WebUIFileOpenPickerActivatedEventArgs sealed : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WebUIFileOpenPickerActivatedEventArgs final : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WebUIFileOpenPickerActivatedEventArgs final : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WebUIFileOpenPickerActivatedEventArgs : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WebUIFileOpenPickerActivatedEventArgs : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
Public NotInheritable Class WebUIFileOpenPickerActivatedEventArgs
Implements IActivatedEventArgsDeferral, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
Public NotInheritable Class WebUIFileOpenPickerActivatedEventArgs
Implements IActivatedEventArgsDeferral, IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
- 继承
- 属性
- 实现
Windows 要求
设备系列 |
Windows 10 (在 10.0.10240.0 中引入)
|
API contract |
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)
|
示例
文件选取器示例演示如何响应 fileOpenPicker 激活事件。
// File open picker activated event handler
function activated(eventObject) {
// Identify whether app is launched for fileOpenPicker
if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.fileOpenPicker) {
// Perform tasks to prepare your app to display its file picker page
// Get file picker UI
fileOpenPickerUI = eventObject.detail.fileOpenPickerUI;
eventObject.setPromise(WinJS.UI.processAll().then(function () {
// Navigate to either the first scenario or to the last running scenario
// before suspension or termination.
var url = scenarios[0].url;
return WinJS.Navigation.navigate(url, fileOpenPickerUI);
}));
}
}
// Register the activated event handler
WinJS.Application.addEventListener("activated", activated, false);
对于 JavaScript, eventObject
包含 webUIFileOpenPickerActivatedEventArgs 对象。
注解
在 Windows.Storage.Pickers.Provider 命名空间参考中的快速入门:通过 和 提供文件服务中了解如何为用户提供从你的应用中选取的文件。
当为 WinJS.Application.Onactivated 或 Windows.UI.WebUI.WebUIApplication.activated 事件实现事件处理程序时,当 ActivationKind 为 fileOpenPicker 时,将访问此对象。
注意
此类不是敏捷类,这意味着需要考虑其线程模型和封送处理行为。 有关详细信息,请参阅 线程处理和封送处理 (C++/CX) 。
版本历史记录
Windows 版本 | SDK 版本 | 增值 |
---|---|---|
1607 | 14393 | User |
属性
ActivatedOperation |
获取应用激活的操作。 |
CallerPackageFamilyName |
获取调用方包的系列名称。 |
FileOpenPickerUI |
获取用户想要选取应用提供的文件或文件夹时显示的文件选取器字母框 UI。 |
Kind |
获取激活类型。 |
PreviousExecutionState |
获取激活前的应用的执行状态。 |
SplashScreen |
获取初始屏幕对象,该对象提供有关从初始屏幕到激活应用转换的信息。 |
User |
获取为其激活应用的用户。 |