A MIDI Library for .NET

InputDevice.StopReceiving Method

Stops this input device from receiving messages.

public void StopReceiving();

Remarks

This method waits for all in-progress input event handlers to finish, and then joins (shuts down) the background thread that was created in StartReceiving. Thus, when this function returns you can be sure that no more event handlers will be invoked.

It is illegal to call this method from an input event handler (ie, from the background thread), and doing so throws an exception. If an event handler really needs to call this method, consider using BeginInvoke to schedule it on another thread.

Exceptions

Exception Type Condition
InvalidOperationException The device is not open; is not receiving; or called from within an event handler (ie, from the background thread).
DeviceException The device cannot start receiving.

See Also

InputDevice Class | Midi Namespace