共用方式為


Grammar.Loaded 屬性

定義

取得語音辨識器是否已經載入 Grammar

public:
 property bool Loaded { bool get(); };
public bool Loaded { get; }
member this.Loaded : bool
Public ReadOnly Property Loaded As 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.");  
  }  
}  

備註

Grammar載入 之後,就無法變更 和 Priority 的值 Weight

適用於

另請參閱