RecognizerInfo.AdditionalInfo 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取有关 SpeechRecognizer 或 SpeechRecognitionEngine 实例的相关附加信息。
public:
property System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ AdditionalInfo { System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ get(); };
public System.Collections.Generic.IDictionary<string,string> AdditionalInfo { get; }
member this.AdditionalInfo : System.Collections.Generic.IDictionary<string, string>
Public ReadOnly Property AdditionalInfo As IDictionary(Of String, String)
属性值
返回包含有关 IDictionary<TKey,TValue> 或 SpeechRecognizer 对象配置信息的 SpeechRecognitionEngine 实例。
示例
下面的示例实现一个按钮单击,该按钮将在中显示对象中的所有信息 RecognizerInfo MessageBox 。
返回的实例中包含的键/值对 IDictionary<TKey,TValue> AdditionalInfo 连接到一个文本表。
private void recognizerInfoButton_Click(object sender, EventArgs e)
{
RecognizerInfo info = _recognizer.RecognizerInfo;
string AudioFormats = "";
foreach (SpeechAudioFormatInfo fmt in info.SupportedAudioFormats)
{
AudioFormats += String.Format(" {0}\n", fmt.EncodingFormat.ToString());
}
string AdditionalInfo = "";
foreach (string key in info.AdditionalInfo.Keys)
{
AdditionalInfo += String.Format(" {0}: {1}\n", key, info.AdditionalInfo[key]);
}
MessageBox.Show(String.Format(
"Name: {0 } \n" +
"Description: {1} \n" +
"SupportedAudioFormats:\n" +
" {2} " +
"Culture: {3} \n" +
"AdditionalInfo: \n" +
" {4}\n",
info.Name.ToString(),
info.Description.ToString(),
AudioFormats,
info.Culture.ToString(),
AdditionalInfo));
}