fix SA1503 for one line if statements

This commit is contained in:
telans
2020-06-20 20:35:29 +12:00
parent 8e3d874802
commit 98db8f72e0
64 changed files with 843 additions and 193 deletions

View File

@@ -259,9 +259,20 @@ namespace Rssdp
/// <seealso cref="DeviceAdded"/>
public void AddDevice(SsdpEmbeddedDevice device)
{
if (device == null) throw new ArgumentNullException(nameof(device));
if (device.RootDevice != null && device.RootDevice != this.ToRootDevice()) throw new InvalidOperationException("This device is already associated with a different root device (has been added as a child in another branch).");
if (device == this) throw new InvalidOperationException("Can't add device to itself.");
if (device == null)
{
throw new ArgumentNullException(nameof(device));
}
if (device.RootDevice != null && device.RootDevice != this.ToRootDevice())
{
throw new InvalidOperationException("This device is already associated with a different root device (has been added as a child in another branch).");
}
if (device == this)
{
throw new InvalidOperationException("Can't add device to itself.");
}
bool wasAdded = false;
lock (_Devices)
@@ -287,7 +298,10 @@ namespace Rssdp
/// <seealso cref="DeviceRemoved"/>
public void RemoveDevice(SsdpEmbeddedDevice device)
{
if (device == null) throw new ArgumentNullException(nameof(device));
if (device == null)
{
throw new ArgumentNullException(nameof(device));
}
bool wasRemoved = false;
lock (_Devices)