Поделиться через


InkRecognizer.SetAsHighestPriorityInkRecognizer - метод

Обновлен: Ноябрь 2007

Sets this InkRecognizer to the highest priority in the InkAnalyzer internal ordered list of recognizers.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink.Analysis (в Microsoft.Ink.Analysis.dll)

Синтаксис

'Декларация
Public Sub SetAsHighestPriorityInkRecognizer
'Применение
Dim instance As InkRecognizer

instance.SetAsHighestPriorityInkRecognizer()
public void SetAsHighestPriorityInkRecognizer()
public:
void SetAsHighestPriorityInkRecognizer()
public void SetAsHighestPriorityInkRecognizer()
public function SetAsHighestPriorityInkRecognizer()

Заметки

Each recognizer contains values that describe its supported languages and supported capabilities. By organizing the available recognizers into an ordered list, the InkAnalyzer can determine which recognizer to use if two or more recognizers support both the same language and capabilities. The InkAnalyzer will store an internal ordered list of recognizers. The internal ordered list will be populated dynamically each time it is called.

ms569538.alert_note(ru-ru,VS.90).gifПримечание.

If performance is slow due to accessing the registry, we may restrict this to only check the registry values when the InkAnalyzer is created.

The internal list will be ordered based on the following logic:

  1. Check to see if the Control Panel application has set an order by looking at the “Recognizers Precedence” registry key values:

    1. “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TPG\Recognizers Precedence”

    2. Each recognizer is listed as a registry sub-key by GUID.

    3. Each registry sub-key has one dword value called “Order”, which is a zero based order (0=first recognizer to use, 1= second recognizer to use… n = last recognizer to use).

    4. If the “Recognizers Precedence” key does not exists, or is corrupted, simply skip to the next step.

  2. Check to see if all installed Microsoft recognizers are represented in the ordered list by checking the “System Recognizer” registry keys. Any Microsoft recognizer that is found on the system but not included in the ordered list will be added to the end of the list, in the order found.

  3. Check to see if all installed external (3rd party) recognizers are represented in the ordered list by checking the “Recognizer” registry keys. Any external recognizer that is found on the system but not included in the ordered list will be added to the end of the list, in the order found.

Once the default ordering is built, applications may change or override the default ordering by calling this method and promoting a recognzier to the top of the list.

Use of the recognizers will be evaluated based on their order in the list:

  • The parser will start with the first recognizer in the list.

  • The first recognizer will be tested to see if it supports the language and capabilities of the ink being recognized.

  • If supported, the recognizer is used.

  • If not supported the next recognizer in the list is checked. Iteration through the list continues until a recognizer is found or the list is exhausted.

  • If no recognizer is found, the TPG_No_Suitable_Recognizer_Found exception is returned.

Примеры

In this example, each InkRecognizer that is available to an InkAnalyzer object is examined. If the InkRecognizer supports language ID 1031 (German), it is set as the highest priority recognizer.

Dim allInkRecognizers As InkRecognizerCollection = mInkAnalyzer.GetInkRecognizersByPriority()
For Each IR As InkRecognizer In allInkRecognizers
    For Each langID As Integer In IR.GetLanguages()
        If langID = 1031 Then
            IR.SetAsHighestPriorityInkRecognizer()
        End If
    Next
Next
InkRecognizerCollection allInkRecognizers = mInkAnalyzer.GetInkRecognizersByPriority();
foreach (InkRecognizer IR in allInkRecognizers)
{
    foreach(int langID in IR.GetLanguages()) 
    {
        if (langID == 1031)
        {
            IR.SetAsHighestPriorityInkRecognizer();
        }
    }
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkRecognizer Класс

InkRecognizer - члены

Microsoft.Ink - пространство имен