RecognizerInfo.AdditionalInfo 属性

定义

获取有关 SpeechRecognizerSpeechRecognitionEngine 实例的相关附加信息。

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<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));  
}  

适用于

另请参阅