Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RecognizerUpdateReachedEventArgs Class

Class passed to handlers of recognition engine update events.

Namespace: System.Speech.Recognition
Assembly: System.Speech (in system.speech.dll)

public class RecognizerUpdateReachedEventArgs : EventArgs
public class RecognizerUpdateReachedEventArgs extends EventArgs
public class RecognizerUpdateReachedEventArgs extends EventArgs
Not applicable.

SpeechRecognitionRejectedEventArgs derives from System.EventArgs.

RecognizerUpdateReached events (SpeechRecognitionEngine.RecognizerUpdateReached andSpeechRecognizer.RecognizerUpdateReached) are generated to provide a mechanism for pausing a recognition engine to apply atomic and synchronous modifications.

An application uses the RequestRecognizerUpdate method (RequestRecognizerUpdateor RequestRecognizerUpdate) to request the generation of RecognizerUpdateReached events.

The example below show a handler for SpeechRecognitionEngine.RecognizerUpdateReached events which loads or unloads Recognition Grammar objects. The handler uses UserToken to obtain information about the recognizer request, created with RequestRecognizerUpdate ,to verify and implement the request.


//Handle requests for Grammar Loads.
_recognizer.RecognizerUpdateReached +=
   delegate(object s, RecognizerUpdateReachedEventArgs args) {
       GrammarRequest request = args.UserToken as GrammarRequest; //cast and check if incoming type is a request
       if (request != null) { // We know this is a Grammar request now
           if (request.Grammar == null)
               throw new ArgumentException("Invalid grammar used.");
       }
       switch (request.RequestType) {
           case GrammarRequestType.LoadGrammarSync:
               RemoveDuplicateGrammar(request.Grammar);
               _recognizer.LoadGrammar(request.Grammar);
               DisplayGrammarLoad(request.Grammar);
               break;
           case GrammarRequestType.LoadGrammarAsync:
               RemoveDuplicateGrammar(request.Grammar);
               _recognizer.LoadGrammarAsync(request.Grammar);
               break;
           case GrammarRequestType.UnloadGrammar:
               _recognizer.UnloadGrammar(request.Grammar);
               DisplayGrammarUnload(request.Grammar);
               break;
       }

System.Object
   System.EventArgs
    System.Speech.Recognition.RecognizerUpdateReachedEventArgs
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.