Class DeviceIsAlreadyDisconnectedException
- Namespace
- Bluetooth.Abstractions.Scanning.Exceptions
- Assembly
- Bluetooth.Abstractions.Scanning.dll
Represents an exception that occurs when a Bluetooth device is already disconnected.
public class DeviceIsAlreadyDisconnectedException : DeviceException, ISerializable
- Inheritance
-
DeviceIsAlreadyDisconnectedException
- Implements
- Inherited Members
Constructors
DeviceIsAlreadyDisconnectedException(IBluetoothRemoteDevice, string, Exception?)
Initializes a new instance of the DeviceIsAlreadyDisconnectedException class.
public DeviceIsAlreadyDisconnectedException(IBluetoothRemoteDevice device, string message = "Device is already disconnected", Exception? innerException = null)
Parameters
deviceIBluetoothRemoteDeviceThe Bluetooth device associated with the exception.
messagestringA message that describes the error.
innerExceptionExceptionThe inner exception that caused the current exception, if any.
Methods
ThrowIfAlreadyDisconnected(IBluetoothRemoteDevice)
Throws a DeviceIsAlreadyDisconnectedException if the device is already disconnected.
public static void ThrowIfAlreadyDisconnected(IBluetoothRemoteDevice device)
Parameters
deviceIBluetoothRemoteDeviceThe Bluetooth device to check.
Exceptions
- ArgumentNullException
Thrown when
deviceis null.- DeviceIsAlreadyDisconnectedException
Thrown when the device is already disconnected.