







Initializes a new instance of the SrgsDocument class specifying the location of the XML document that is used to fill in the SrgsDocument instance.
Namespace:
Microsoft.Speech.Recognition.SrgsGrammar
Assembly:
Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Sub New ( _ path As String _ ) |
| Visual Basic (Usage) |
|---|
Dim path As String Dim instance As New SrgsDocument(path) |
| C# |
|---|
public SrgsDocument( string path ) |
Parameters
- path
- Type: System..::..String
The location of the SRGS XML file.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | path is nullNothingnullptrunita null reference (Nothing in Visual Basic). |
| ArgumentException | path is an empty string. |
Examples
The following example creates a new SrgsDocument from the file named "srgsDocumentFile.xml".
| C# | Copy Code |
|---|---|
string srgsDocumentFile = Path.Combine(Path.GetTempPath(), "srgsDocumentFile.xml");
SrgsDocument document = null;
if (File.Exists(srgsDocumentFile))
document = new SrgsDocument(srgsDocumentFile); | |
