SrgsDocument.Root Property
Gets or sets the root rule of the SrgsDocument class.
Namespace: Microsoft.Speech.Recognition.SrgsGrammar
Assembly: Microsoft.Speech (in microsoft.speech.dll)
Syntax
'Declaration
Public Property Root As SrgsRule
public SrgsRule Root { get; set; }
public:
property SrgsRule^ Root {
SrgsRule^ get ();
void set (SrgsRule^ value);
}
/** @property */
public SrgsRule get_Root ()
/** @property */
public void set_Root (SrgsRule value)
public function get Root () : SrgsRule
public function set Root (value : SrgsRule)
Property Value
The SrgsRule that is designated to be the root rule of SrgsDocument.
Remarks
The rule must already be in the document's rule collection before it can be set to the root rule.
Example
The following example creates a rule named rootRule, and then creates an SrgsDocument object named document. The example then calls the Add method to add the rule to the document. Finally, the example sets the document's Root property to rootRule, thereby making it the root rule.
SrgsRule rootRule = new SrgsRule("WorldCupWinner");
rootRule.Scope = SrgsRuleScope.Public;
SrgsDocument document = new SrgsDocument();
document.Rules.Add(rootRule);
document.Root = rootRule;
Thread Safety
All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.
Platforms
Development Platforms
Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition
Target Platforms
See Also
Reference
SrgsDocument Class
SrgsDocument Members
Microsoft.Speech.Recognition.SrgsGrammar Namespace
SrgsRule