Grammar.Loaded 属性

定义

获取 Grammar 是否已经由语音识别器加载。

public:
 property bool Loaded { bool get(); };
public bool Loaded { get; }
member this.Loaded : bool
Public ReadOnly Property Loaded As Boolean

属性值

Boolean

如果引用的语音识别语法在语音识别器当前加载, Loaded 属性返回 true ;否则该属性返回 false。 默认值为 false

示例

以下示例将有关 Grammar 对象的信息写入 控制台

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);  
  }  
  else  
  {  
    Console.WriteLine("  The Grammar does not specify a root rule.");  
  }  
}  

注解

加载 a Grammar 后,无法更改其值WeightPriority

适用于

另请参阅