Recognizer.Capabilities 属性
获取 Recognizer 对象的功能。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
Public ReadOnly Property Capabilities As RecognizerCapabilities
用法
Dim instance As Recognizer
Dim value As RecognizerCapabilities
value = instance.Capabilities
public RecognizerCapabilities Capabilities { get; }
public:
property RecognizerCapabilities Capabilities {
RecognizerCapabilities get ();
}
/** @property */
public RecognizerCapabilities get_Capabilities()
public function get Capabilities () : RecognizerCapabilities
属性值
类型:Microsoft.Ink.RecognizerCapabilities
定义识别器 功能的值。
备注
识别器的功能是在 RecognizerCapabilities 枚举中定义的,这些功能包括识别器是否支持字符自动完成;是否支持自由输入、行输入或框式输入,等等。有关识别器功能的完整列表,请参见 RecognizerCapabilities 枚举。
若要确定识别器是否具有某项特定功能,请使用按位比较运算符检查确认是否具有此项功能。有关按位比较运算原理的更多信息,请参见 And Operator(“与”运算符)。
示例
此示例中,将支持德语(语言 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