StateChangedEventArgs Class

Returns data from the StateChanged event.

Namespace: Microsoft.Speech.Recognition
Assembly: Microsoft.Speech (in microsoft.speech.dll)

Syntax

'Declaration
Public Class StateChangedEventArgs
    Inherits EventArgs
public class StateChangedEventArgs : EventArgs
public ref class StateChangedEventArgs : public EventArgs
public class StateChangedEventArgs extends EventArgs
public class StateChangedEventArgs extends EventArgs

Remarks

The StateChanged event is raised by the

SpeechRecognitionEngine class.

System state can be changed programmatically by setting the Enabled property of a recognition engine or through the Speech member of ControlPanel.

StateChangedEventArgs derives from System.EventArgs and is passed to handlers for StateChanged events.

Inheritance Hierarchy

System.Object
   System.EventArgs
    Microsoft.Speech.Recognition.StateChangedEventArgs

Example

The example below updates a display based on the state information provided by and instance of RecognizerState obtained from the RecognizerState property of an instance of StateChangedEventArgs passed to a handler for a StateChanged.

//Make sure that _recognizer and recognition start buttons are disabled if state is stopped.
//Reenable the start button to allow manual reenable if start is listening
_recognizer.StateChanged +=
    delegate(object sender, StateChangedEventArgs eventArgs) {
        _recognizerStateLabel.Text = "Speech Recognizer State: " + eventArgs.RecognizerState.ToString();
    };

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

StateChangedEventArgs Members
Microsoft.Speech.Recognition Namespace
RecognizerState
StateChanged
RecognizerState Enumeration
RecognizerState Enumeration