Grammar Constructor (Stream, String, Object[])

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the Grammar class from a Stream and specifies a root rule.

Namespace:   System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)

public Grammar(
	Stream stream,
	string ruleName,
	object[] parameters
)

Parameters

stream
Type: System.IO.Stream

A Stream connected to an input/output object (including files, VisualStudio Resources, and DLLs) that contains a grammar specification.

ruleName
Type: System.String

The identifier of the rule to use as the entry point of the speech recognition grammar, or null to use the default root rule of the grammar description.

parameters
Type: System.Object[]

Parameters to be passed to the initialization handler specified by the OnInit property for the entry point or the root rule of the Grammar to be created. This parameter may be null.

Exception Condition
System.ArgumentException

stream is connected to a grammar that:

  • Does not contain the rule specified in ruleName

  • Requires initialization parameters different from those specified in parameters

  • Contains a relative rule reference that cannot be resolved by the default base Uri rule for grammars

Parameters for an initialization handler may also be specified.

.NET Framework
Available since 3.0
Return to top
Show: