SrgsDocument Constructor (String)

Microsoft Speech Platform SDK 11

Collapse imageExpand ImageCopy imageCopyHover image

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

ExceptionCondition
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 imageCopy Code
string srgsDocumentFile = Path.Combine(Path.GetTempPath(), "srgsDocumentFile.xml");
SrgsDocument document = null;

if (File.Exists(srgsDocumentFile))
   document = new SrgsDocument(srgsDocumentFile);

See Also