AppInstance 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示应用的实例。
public ref class AppInstance sealed
/// [Windows.Foundation.Metadata.Experimental]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class AppInstance final
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppLifecycle.AppLifecycleContract, 65536)]
class AppInstance final
[Windows.Foundation.Metadata.Experimental]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public sealed class AppInstance
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AppLifecycle.AppLifecycleContract), 65536)]
public sealed class AppInstance
Public NotInheritable Class AppInstance
- 继承
- 属性
示例
有关演示了如何使用此类的代码示例,请参阅 App 实例化。
注解
有关使用此类的详细信息,请参阅 App 实例化。
属性
| 名称 | 说明 |
|---|---|
| IsCurrent |
获取一个值,该值指示此 AppInstance 对象是否表示应用的当前实例或其他实例。 |
| Key |
获取一个应用定义的字符串值,该值标识用于重定向的当前应用实例。 |
| ProcessId |
获取应用实例的进程 ID。 |
方法
| 名称 | 说明 |
|---|---|
| FindOrRegisterForKey(String) |
向平台注册应用实例,或者如果另一个实例已注册此密钥,则查找现有实例。 |
| GetActivatedEventArgs() |
检索使用 ActivationRegistrationManager 类的静态方法之一注册的应用激活的事件参数。 |
| GetCurrent() |
检索应用的当前正在运行的实例。 |
| GetInstances() |
检索应用的所有正在运行实例的集合。 |
| RedirectActivationToAsync(AppActivationArguments) |
将当前激活请求重定向到另一个应用实例。 |
| Restart(String) |
重启应用程序实例。 |
| UnregisterKey() |
取消注册此应用实例的给定密钥。 |
活动
| 名称 | 说明 |
|---|---|
| Activated |
针对已通过 Microsoft.Windows 重定向的激活引发。AppLifecycle.AppInstance.RedirectActivationToAsync。 |