/// <summary> /// Closes this output device. /// </summary> /// <exception cref="InvalidOperationException">The device is not open.</exception> /// <exception cref="DeviceException">The device cannot be closed.</exception> public void Close() { lock (this) { CheckOpen(); CheckReturnCode(Win32API.midiOutClose(handle)); isOpen = false; } }