![Collapse image Collapse image](collapse_all.gif)
![Expand Image Expand Image](expand_all.gif)
![](collapse_all.gif)
![](expand_all.gif)
![](dropdown.gif)
![](dropdownHover.gif)
![Copy image Copy image](copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Initializes a new instance of the SrgsDocument class from an instance of XmlReader that references an XML-format grammar file.
Namespace:
Microsoft.Speech.Recognition.SrgsGrammar
Assembly:
Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub New ( _ srgsGrammar As XmlReader _ ) |
Visual Basic (Usage) |
---|
Dim srgsGrammar As XmlReader Dim instance As New SrgsDocument(srgsGrammar) |
C# |
---|
public SrgsDocument( XmlReader srgsGrammar ) |
Parameters
- srgsGrammar
- Type: System.Xml..::..XmlReader
The XmlReader that was created with the SrgsDocument XML instance.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | srgsGrammar is nullNothingnullptrunita null reference (Nothing in Visual Basic). |
Examples
The following example creates a new instance of SrgsDocument from an instance of XmlReader that references the file "srgsDocumentFile.xml".
C# | ![]() |
---|---|
string srgsDocumentFile = Path.Combine(Path.GetTempPath(), "srgsDocumentFile.xml");
SrgsDocument document = null;
if (File.Exists(srgsDocumentFile))
{
XmlReader reader = XmlReader.Create(srgsDocumentFile);
document = new SrgsDocument(reader);
reader.Close();
} |