/// <summary> /// Takes this device offline by removing it from the bus. /// </summary> public virtual void Disconnect() { var error = ViGEmClient.vigem_target_remove(Client.NativeHandle, NativeHandle); switch (error) { case ViGEmClient.VIGEM_ERROR.VIGEM_ERROR_NONE: break; case ViGEmClient.VIGEM_ERROR.VIGEM_ERROR_BUS_NOT_FOUND: throw new VigemBusNotFoundException(); case ViGEmClient.VIGEM_ERROR.VIGEM_ERROR_TARGET_UNINITIALIZED: throw new VigemTargetUninitializedException(); case ViGEmClient.VIGEM_ERROR.VIGEM_ERROR_TARGET_NOT_PLUGGED_IN: throw new VigemTargetNotPluggedInException(); case ViGEmClient.VIGEM_ERROR.VIGEM_ERROR_REMOVAL_FAILED: throw new VigemRemovalFailedException(); default: throw new Win32Exception(Marshal.GetLastWin32Error()); } }
/// <summary> /// Takes this device offline by removing it from the bus. /// </summary> public virtual void Disconnect() { var error = ViGEmClient.vigem_target_remove(Client.NativeHandle, NativeHandle); switch (error) { case VIGEM_ERROR.VIGEM_ERROR_BUS_NOT_FOUND: case VIGEM_ERROR.VIGEM_ERROR_TARGET_UNINITIALIZED: case VIGEM_ERROR.VIGEM_ERROR_TARGET_NOT_PLUGGED_IN: case VIGEM_ERROR.VIGEM_ERROR_REMOVAL_FAILED: throw new ViGEmException(error); } }