VoiceCommandResponse 类

定义

来自后台应用服务的响应,用于 在 Cortana 画布上显示的进度、确认、消除歧义、完成或失败屏幕。

public ref class VoiceCommandResponse sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class VoiceCommandResponse final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class VoiceCommandResponse
Public NotInheritable Class VoiceCommandResponse
继承
Object Platform::Object IInspectable VoiceCommandResponse
属性

Windows 要求

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

注解

除非应用有权访问 VoiceCommandServiceConnection 对象,否则后台应用服务无法使用 VoiceCommandResponse 对象在 Cortana 画布上显示任何内容。 只有当从 Cortana 调用后台应用服务时,才会创建 VoiceCommandServiceConnection 对象。

属性

AppLaunchArgument

获取或设置一个字符串作为启动参数,该参数可由后台应用服务与响应相关联。

AppLaunchArgument 用于指定通过 Cortana 中的深层链接启动时前台应用的状态或上下文。

MaxSupportedVoiceCommandContentTiles

获取后台应用服务可在 Cortana 画布上显示的最大内容磁贴数。

Message

由 Cortana 说出并在 Cortana 画布上显示的初始消息。

此消息应为:

RepeatMessage

如果未理解响应,则辅助消息 (消除歧义和确认屏幕,仅) Cortana 说出并在 Cortana 画布上显示。

此消息应是第一条消息和以下消息之一的变体:

VoiceCommandContentTiles

资产集合,包含图像和文本数据,由背景应用服务提供,用于在 Cortana 画布上显示。

方法

CreateResponse(VoiceCommandUserMessage)

创建用于调用 ReportProgressAsyncReportSuccessAsyncReportFailureAsyncVoiceCommandResponse 对象。

CreateResponse(VoiceCommandUserMessage, IIterable<VoiceCommandContentTile>)

创建用于调用 ReportProgressAsyncReportSuccessAsyncReportFailureAsyncVoiceCommandResponse 对象。

CreateResponseForPrompt(VoiceCommandUserMessage, VoiceCommandUserMessage)

创建用于调用 RequestConfirmationAsyncRequestDisambiguationAsyncVoiceCommandResponse 对象。

CreateResponseForPrompt(VoiceCommandUserMessage, VoiceCommandUserMessage, IIterable<VoiceCommandContentTile>)

创建用于调用 RequestConfirmationAsyncRequestDisambiguationAsyncVoiceCommandResponse 对象。

适用于

另请参阅