This documentation is archived and is not being maintained.

SrgsDocument.Root Property

Gets or sets the root rule of the SrgsDocumentclass.

Namespace: System.Speech.Recognition.SrgsGrammar
Assembly: System.Speech (in system.speech.dll)

public SrgsRule Root { get; set; }
/** @property */
public SrgsRule get_Root ()

/** @property */
public void set_Root (SrgsRule value)

public function get Root () : SrgsRule

public function set Root (value : SrgsRule)

Not applicable.

Property Value

The SrgsRule that is designated to be the root rule of SrgsDocument.

The rule must already be in the document's rule collection before it can be set to the root rule.

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;

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.

.NET Framework

Supported in: 3.0
Show: