CortanaPermissionsManager 类

定义

向用户提供对 Cortana 授权设置的访问权限。

public ref class CortanaPermissionsManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class CortanaPermissionsManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Deprecated("CortanaPermissionsManager is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 655360, "Windows.Foundation.UniversalApiContract")]
class CortanaPermissionsManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class CortanaPermissionsManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Deprecated("CortanaPermissionsManager is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 655360, "Windows.Foundation.UniversalApiContract")]
public sealed class CortanaPermissionsManager
Public NotInheritable Class CortanaPermissionsManager
继承
Object Platform::Object IInspectable CortanaPermissionsManager
属性

Windows 要求

设备系列
Windows 10 Creators Update (在 10.0.15063.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v4.0 中引入)
应用功能
cortanaPermissions

注解

这是一个静态类,无需获取 CortanaPermissionsManager 对象即可访问其成员。

CortanaPermissionManager 类要求将以下内容添加到 Package.appmanifest:

  • 要 <打包>
    • xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
    • IgnorableNamespaces="rescap"
  • 在“功能”下<>
    • <rescap:capability name="cortanaPermissions"/>

方法

ArePermissionsGrantedAsync(IIterable<CortanaPermission>)

异步检索是否授予指定权限。

GetDefault()

检索当前用户的 Cortana 权限。

GrantPermissionsAsync(IIterable<CortanaPermission>)

异步授予指定的 Cortana 权限集。

IsSupported()

检索是否支持 Cortana。

RevokePermissionsAsync(IIterable<CortanaPermission>)

异步撤销指定的 Cortana 权限集。

适用于