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

另请参见

参考

Recognizer 类

Recognizer 成员

Microsoft.Ink 命名空间

Recognizers