Export (0) Print
Expand All

Grammar.Loaded Property

Gets whether a Grammar has been loaded by a speech recognizer.

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

public bool Loaded { get; }

Property Value

Type: System.Boolean
The Loaded property returns true if the referenced speech recognition grammar is currently loaded in a speech recognizer; otherwise the property returns false. The default is false.

Once a Grammar has been loaded, the values of Weight, and Priority cannot be changed.

The following example writes information about a Grammar object to the console.

private static void DumpGrammarStatus(Grammar item)
  Console.WriteLine("Grammar name is {0}:", item.Name);
  Console.WriteLine("  The Grammar {0} loaded.",
    item.Loaded ? "is" : "is not");
  Console.WriteLine("  The Grammar {0} enabled.",
    item.Enabled ? "is" : "is not");
  if (item.RuleName != null)
    Console.WriteLine("  The root rule is {0}.", item.RuleName);
    Console.WriteLine("  The Grammar does not specify a root rule.");

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4
© 2015 Microsoft