diff options
| author | telans <telans@protonmail.com> | 2020-06-20 21:12:36 +1200 |
|---|---|---|
| committer | telans <telans@protonmail.com> | 2020-06-20 21:12:36 +1200 |
| commit | 7f307f9082cb4be296e745c2c066334858f000af (patch) | |
| tree | 4f5e3ca5a628624f631ccf1da9deeed90481d9bc /RSSDP/SsdpDeviceLocator.cs | |
| parent | 98db8f72e01b608e6c384ecf5b107fc2d105b652 (diff) | |
brace multiline if statements
Diffstat (limited to 'RSSDP/SsdpDeviceLocator.cs')
| -rw-r--r-- | RSSDP/SsdpDeviceLocator.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.cs index a774ee23c..9a31db7a2 100644 --- a/RSSDP/SsdpDeviceLocator.cs +++ b/RSSDP/SsdpDeviceLocator.cs @@ -217,10 +217,12 @@ namespace Rssdp.Infrastructure var handlers = this.DeviceAvailable; if (handlers != null) + { handlers(this, new DeviceAvailableEventArgs(device, isNewDevice) { LocalIpAddress = localIpAddress }); + } } /// <summary> @@ -426,7 +428,9 @@ namespace Rssdp.Infrastructure }; if (NotificationTypeMatchesFilter(deadDevice)) + { OnDeviceUnavailable(deadDevice, false); + } } } } @@ -439,7 +443,9 @@ namespace Rssdp.Infrastructure { message.Headers.TryGetValues(headerName, out values); if (values != null) + { retVal = values.FirstOrDefault(); + } } return retVal; @@ -453,7 +459,9 @@ namespace Rssdp.Infrastructure { message.Headers.TryGetValues(headerName, out values); if (values != null) + { retVal = values.FirstOrDefault(); + } } return retVal; @@ -467,7 +475,9 @@ namespace Rssdp.Infrastructure { request.Headers.TryGetValues(headerName, out values); if (values != null) + { value = values.FirstOrDefault(); + } } Uri retVal; @@ -483,7 +493,9 @@ namespace Rssdp.Infrastructure { response.Headers.TryGetValues(headerName, out values); if (values != null) + { value = values.FirstOrDefault(); + } } Uri retVal; @@ -560,7 +572,9 @@ namespace Rssdp.Infrastructure foreach (var removedDevice in existingDevices) { if (NotificationTypeMatchesFilter(removedDevice)) + { OnDeviceUnavailable(removedDevice, expired); + } } return true; @@ -572,7 +586,9 @@ namespace Rssdp.Infrastructure private TimeSpan SearchTimeToMXValue(TimeSpan searchWaitTime) { if (searchWaitTime.TotalSeconds < 2 || searchWaitTime == TimeSpan.Zero) + { return OneSecond; + } else return searchWaitTime.Subtract(OneSecond); } |
