This topic has not yet been rated - Rate this topic

SpeechRecognitionEngine.UnloadAllGrammars Method

Unloads all Grammar objects currently loaded in by a Windows Desktop Speech Technology recognition engine.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
public void UnloadAllGrammars()

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.

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;

}

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.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ