SpeechRecognitionEngine.UnloadAllGrammars Method
Unloads all Grammar objects currently loaded by a recognition engine.
Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)
Syntax
'Declaration
Remarks
If there are calls to LoadGrammarAsync that are still loading Grammar objects when UnloadAllGrammars is called, the UnloadAllGrammarscall will block until all the Grammar objects are loaded, and then unload those objects.
Example
The following example unloads all Grammar objects prior to as part of an implementation of Dispose.
public new void Dispose(bool disposing)
{
if (!this.disposed) {
_recognizer.UnloadAllGrammars();
if (disposing) {
_recognizer.Dispose();
base.Dispose();
}
}
this.disposed = true;
}
Thread Safety
All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.
Platforms
Development Platforms
Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition
Target Platforms
See Also
Reference
SpeechRecognitionEngine Class
SpeechRecognitionEngine Members
Microsoft.Speech.Recognition Namespace
UnloadGrammar