Recognizer.Languages 屬性
為 Recognizer 物件支援的語言取得語言識別項的陣列。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public ReadOnly Property Languages As Short()
'用途
Dim instance As Recognizer
Dim value As Short()
value = instance.Languages
public short[] Languages { get; }
public:
property array<short>^ Languages {
array<short>^ get ();
}
/** @property */
public short[] get_Languages()
public function get Languages () : short[]
屬性值
型別:array<System.Int16[]
Recognizer 物件支援之語言的語言識別項。
備註
這個屬性可用來在 Recognizers 集合中搜尋支援特定語言的 Recognizer 物件。
就物件和筆勢辨識器而言,這個屬性會傳回空陣列。
範例
在這個範例中,會將支援德文 (語言 ID 1031)、RecognizerCapabilities 功能 LinedInput 和 ConfidenceLevel 的第一個 Recognizer 指派給已選取的 Recognizer 物件變數。
Dim selectedRecognizer As Recognizer = Nothing
Dim allRecognizers As Recognizers = New Recognizers()
For Each oneReco As Recognizer In allRecognizers
' if we haven't found the one we want yet
If Not selectedRecognizer Is Nothing Then
' if supports LinedInput
If (oneReco.Capabilities And RecognizerCapabilities.LinedInput) <> 0 Then
For Each langID As Short In oneReco.Languages
' if supports German (1031)
If langID = 1031 Then
For Each propertyGuid As Guid In oneReco.SupportedProperties
' if supports ConfidenceLevel
If propertyGuid = RecognitionProperty.ConfidenceLevel Then
' assign selected
selectedRecognizer = oneReco
End If
Next
End If
Next
End If
End If
Next
Recognizer selectedRecognizer = null;
Recognizers allRecognizers = new Recognizers();
foreach (Recognizer oneReco in allRecognizers)
{
// if we haven't found the one we want yet
if (null == selectedRecognizer)
{
// if supports LinedInput
if ((oneReco.Capabilities & RecognizerCapabilities.LinedInput) != 0)
{
foreach (short langID in oneReco.Languages)
{
// if supports German (1031)
if (langID == 1031)
{
foreach (Guid propertyGuid in oneReco.SupportedProperties)
{
// if supports ConfidenceLevel
if (propertyGuid == RecognitionProperty.ConfidenceLevel)
{
// assign selected
selectedRecognizer = oneReco;
}
}
}
}
}
}
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0