Grammar.Enabled Property
.NET Framework 3.0
Gets or sets a value controlling whether a Grammar can be used by a recognition engine.
Namespace: System.Speech.Recognition
Assembly: System.Speech (in system.speech.dll)
Assembly: System.Speech (in system.speech.dll)
/** @property */ public boolean get_Enabled () /** @property */ public void set_Enabled (boolean value)
public function get Enabled () : boolean public function set Enabled (value : boolean)
Not applicable.
Property Value
Property is a bool value which is set to true if an instance of Grammar is enabled and ready to process input, and false it the instance is not available for input processing.An instance of Grammar may be enabled or disabled independently of being loaded by a recognition engine (SpeechRecognizer or SpeechRecognitionEngine);
The example below show a check box handler for a Windows.Forms.TreeView. When the box is checked, the grammar is enabled.
private void _grammarTreeView_AfterCheck(object sender, TreeViewEventArgs eventArgs) {
if (eventArgs.Action != TreeViewAction.Unknown) { // Avoid recurse due to hanlders
if (eventArgs.Node.Parent == null) {
Grammar grammar=((Grammar)eventArgs.Node.Tag);
grammar.Enabled = eventArgs.Node.Checked;
PropagateCheckStatus(eventArgs.Node);
} else {
PropagateCheckStatus(eventArgs.Node.Parent);
}
}
}
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.