Use null propagation

This commit is contained in:
Stepan Goremykin
2023-10-08 01:25:37 +02:00
parent 212976277d
commit fdef9356b9
9 changed files with 20 additions and 59 deletions

View File

@@ -227,13 +227,10 @@ namespace Rssdp.Infrastructure
}
var handlers = this.DeviceAvailable;
if (handlers is not null)
handlers?.Invoke(this, new DeviceAvailableEventArgs(device, isNewDevice)
{
handlers(this, new DeviceAvailableEventArgs(device, isNewDevice)
{
RemoteIPAddress = IPAddress
});
}
RemoteIPAddress = IPAddress
});
}
/// <summary>
@@ -250,10 +247,7 @@ namespace Rssdp.Infrastructure
}
var handlers = this.DeviceUnavailable;
if (handlers is not null)
{
handlers(this, new DeviceUnavailableEventArgs(device, expired));
}
handlers?.Invoke(this, new DeviceUnavailableEventArgs(device, expired));
}
/// <summary>