Method DeleteDeviceAsync
- Namespace
- Kepware.Api.ClientHandler
- Assembly
- Kepware.Api.dll
DeleteDeviceAsync(Device, CancellationToken)
Deletes the specified device.
public Task<bool> DeleteDeviceAsync(Device device, CancellationToken cancellationToken = default)
Parameters
device
DeviceThe device to delete.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating whether the deletion was successful.
Exceptions
- ArgumentNullException
Thrown when the device is null.
DeleteDeviceAsync(string, string, CancellationToken)
Deletes the device with the specified name in the specified channel.
public Task<bool> DeleteDeviceAsync(string channelName, string deviceName, CancellationToken cancellationToken = default)
Parameters
channelName
stringThe name of the channel to which the device belongs.
deviceName
stringThe name of the device to delete.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating whether the deletion was successful.
Exceptions
- ArgumentException
Thrown when the channel name or device name is null or empty.