Grammar Constructor (Stream^, String^, array<Object^>^)

 

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,
	array<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: array<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: