RecognizerUpdateReachedEventArgs Class
Returns data from the RecognizerUpdateReached event.
Assembly: System.Speech (in System.Speech.dll)
The RecognizerUpdateReached event is raised by the SpeechRecognizer and SpeechRecognitionEngine classes.
SpeechRecognitionRejectedEventArgs derives from [System.EventArgs].
RecognizerUpdateReached events 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 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;
}
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.